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 Search/Move Columns Bug
GridCtrl Search/Move Columns Bug [message #21872] Mon, 08 June 2009 20:12 Go to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
I have a Grid control: Subject, Created At, Modified At. It's been working great with search. I then added Movable Columns. It still works great. However, if I take and move Created At or Modified At in front of Subject and then try to search I get an error:

Assertion failed in c:\develop\projects\upp\uppsrc\core\Value.h, line 461
Invalid value conversion: class Upp::RichValueRep<class Upp:WString> -> struct Upp::Time


My grid is setup:

items.AddIndex(ID);
items.AddColumn(SUBJECT, "Subject").Edit(subjectEdit);
items.AddColumn(CREATED_AT, "Created", 15).SetConvert(Single<ConvTimeAgo>());
items.AddColumn(MODIFIED_AT, "Modified", 15).SetConvert(Single<ConvTimeAgo>());


subjectEdit is a EditStringNotNull.
ConvTimeAgo is:

struct ConvTimeAgo : Convert
{
    Value Format(const Value &q) const
    {
        Time dt = (Time) q;
        Time now = GetSysTime();
        int64 diff = now - dt;
				
        if (q.IsNull())
            return "";
        if (diff > (SECS_PER_DAY * 7))
            return ::Format("%02d/%02d/%04d", dt.month, dt.day, dt.year);
        if (diff > SECS_PER_DAY)
            return ::Format("Last %Day", ::DayOfWeek(dt));
        if (diff > SECS_PER_HOUR)
            return ::Format("%d hours ago", diff / SECS_PER_HOUR);
        if (diff > SECS_PER_MINUTE)
            return ::Format("%d minutes ago", diff / SECS_PER_MINUTE);
        return ::Format("%d seconds ago", diff);
}
};


Jeremy
Re: GridCtrl Search/Move Columns Bug [message #21912 is a reply to message #21872] Wed, 10 June 2009 15:22 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Can anyone confirm this at least?

Jeremy
Re: GridCtrl Search/Move Columns Bug [message #21967 is a reply to message #21912] Fri, 12 June 2009 23:03 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

jeremy_c wrote on Wed, 10 June 2009 09:22

Can anyone confirm this at least?

Jeremy


Fixed. Thanks for reporting this!
Re: GridCtrl Search/Move Columns Bug [message #22011 is a reply to message #21967] Sun, 14 June 2009 21:46 Go to previous message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
It now works for me. Thanks!

Jeremy
Previous Topic: DropDate in GridCtrl ... Howto populate on insert?
Next Topic: GridCtrl: How to respond to moving a row?
Goto Forum:
  


Current Time: Sat Apr 20 07:55:23 CEST 2024

Total time taken to generate the page: 0.06338 seconds