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: How to respond to moving a row?
Re: GridCtrl: How to respond to moving a row? [message #21926 is a reply to message #21924] Thu, 11 June 2009 01:50 Go to previous messageGo to previous message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Great, however... Before you apply it, I think it needs some help. I am willing to work with it some more if you think it's worth while, however, this is my first venture into the U++ libs and it may take some time for me to figure out when you could whip it up in 10 minutes.

Right now, it simply calls a callback letting you know that something moved. It does not report what moved where. I was thinking it would be better to be able to let the callback know that row 1 was inserted after row 5. The problem right now is that say you have a db that contains ID, NAME, POSITION. Pretty easy. Well, when you get a "WhenMove" callback, you have to:

try
{
    for (int i=0; i < questions.GetCount(); i++)
    {
        SQL & ::Update(HIVE_ACC_Q)
            (POSITION, Value(i))
            .Where(ID == questions.Get(i, 0));
    }
}
catch (SqlExc &exc)
{
    Exclamation("[* " + DeQtfLf(exc) + "]");
}


If, however, we would send row 1 moved to row 5, that function could update rows only 1 - 5, instead of possibly 1 - 10,000 (maybe a bit extreme).

Further, it would be nice to have:

catch (SqlExc &exc)
{
    questions.CancelMove();
    // .....
}


as we have CancelInsert, CancelUpdate, etc...

BTW... Cool on the new car! I got a new car, but it's a minivan as my family has grown now to 4 daughters Smile

Jeremy
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GridCtrl Search/Move Columns Bug
Next Topic: Grid Search Color on XP = very hard to read
Goto Forum:
  


Current Time: Tue May 14 14:23:53 CEST 2024

Total time taken to generate the page: 0.01457 seconds