Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Option error in GridCtrl
Option error in GridCtrl [message #48182] |
Wed, 31 May 2017 11:54 |
germax
Messages: 20 Registered: March 2017 Location: germany
|
Promising Member |
|
|
I have a serious issue with adding an option value to a GridCtrl
here's the setup code (in parts) of the grid
grid.Ready(false);
grid.Reset();
grid.AddHiddenColumn("ID");
grid.AddColumn(t_("Check"),50).Option();
//some more columns... none a checkbox option
grid.AddColumn(t_("Num"),45).Edit(snum);
// SQL SELECT
if(SQL.WasError())
{
//ERROR HANDLING
}
while(SQL.Fetch())
{
// some calculation for num.... let's say random -100 to 100 to make it easier
bool ord = (num >= 0);
grid.Add(SQL[ID], ord /*,..more columns..*/);
}
grid.Ready(true);
grid.EditCell();
grid.Sort(1,2,true,false);
//grid.Sort(6,2,true,true); //num from earlier
And that works just fine, the checkbox is shown, and marked where ord is true unmarked where ord is false,
and sorted correctly, everything's violets in bloom..
Now, when I reorder said grid, check and uncheck the boxes more than once
maybe resort inbetween selecting or deselecting the checkbox option...
at one point the "decreased order sorting for column 1 [checkbox]" shows some "unchecked" boxes in between checked ones.
(as if they were checked but the graphic isn't updating properly)
And they behave just like they were checked while parsing the grid..
FOREACH_ROW(grid)
{
if(grid(1) /*&& int(grid(6))>0*/) // checkbox ticked and num > 0
{
// writing to SQL, exporting to csv...
// nothing too interesting really
}
}
parses them and writes corresponding values to the database and the exported csv file.
visually unchecked boxes are still checked somehow *shrugs*
It took me quite a while to reproduce the error myself,
and frankly all I can think of is that "freaking" (that other word) re_numbering of the grid again.
Maybe the Option internally switching to a tri-state or something...
IDK.
Any ideas on how to prevent that?
the num edit (the only other editable field in the grid) is behaving normal.. btw,
it's just the checkbox (or solely it's graphic) that's not.
thank you
that other german guy
[Updated on: Wed, 31 May 2017 12:05] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri May 09 11:29:48 CEST 2025
Total time taken to generate the page: 0.00882 seconds
|