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 » Two "basic" operations on GridCtrl
Re: Two "basic" operations on GridCtrl [message #21132 is a reply to message #21128] Mon, 04 May 2009 15:22 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

kbyte wrote on Mon, 04 May 2009 08:02

Great!
For the case of date data type, is there any way to format it to be displayed in some language format while beeing stored as a date value inside gridcontrol (usefull for good sorting operation)?


Of course.

struct MyDataConvert : Convert
{
   Value Format(const Value& q) const
   {
       const Data& d = q; 
       return Format("%4d/%2d/%2d", d.year, d.month. d.day);
   }
};

grid.AddColumn("Date column").SetConvert(Single<MyDataConvert>());


Just have a look at reference assembly. There is a nice example about converters.
 
Read Message
Read Message
Read Message
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: ArrayCtrl.AsQtf bug?
Next Topic: LineEdit font bug
Goto Forum:
  


Current Time: Fri Jun 07 05:33:57 CEST 2024

Total time taken to generate the page: 0.01480 seconds