Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl empty cells pasted from Excel
Re: GridCtrl empty cells pasted from Excel [message #17699 is a reply to message #17362] Tue, 26 August 2008 16:11 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3443
Registered: August 2008
Senior Veteran
Well, I have changed SetPaint by SetConvert(Single<ConvBool>()) defined as:

struct ConvBool : Convert
{
Value Format(const Value &q) const
{
if (!q.IsNull()) {
if (q.Is<String>())
return (String(q) == "1") ? "Yes" : "No";
else if (IsNumber(q))
return (int(q) == 1) ? "Yes" : "No";
else
return "¿?";
} else
return Null;
}
};

so SetConvert asssures the way some column is going to be shown as text, as SetPaint sets the way the column is going to be painted as a draw o picture.

Anyway, to questions:
- Is there any way to convert safely a Value to a String?.
- When you put "myGridCtrl.AddColumn(ISMARRIED, t_("Is married?")).EditConvert(isMarried).Default(-1);", how do you define the struct Convert with "Value Format(const Value &q) const" inside?


Best regards
Iñaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: adding row from another window and updating GUI
Next Topic: Unicode character paste in GridCtrl
Goto Forum:
  


Current Time: Sun Aug 24 15:19:45 CEST 2025

Total time taken to generate the page: 0.03818 seconds