Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Select Grid Row BY ID
Re: Select Grid Row BY ID [message #48029 is a reply to message #48009] |
Thu, 11 May 2017 20:17   |
germax
Messages: 20 Registered: March 2017 Location: germany
|
Promising Member |
|
|
Ah well..
yes, isFinished instead.. with a processEvent... checked (I take notes )
The rest 
This is just insane....
I tested with such loop:
for (int i = 0; i < grid.GetCount(); i++)
{
grid.GetRow(i).Bg(LtGray());
String item = grid(i,5);
if (ToUpper(TrimBoth(item)).StartsWith("SHIPPING"))
{
continue; // skips the SQL query and i gets increased by the for loop
}
SQL * Select(SqlAll()).From(Whatever).Where(....);
if(SQL.Fetch()){//some if then elses again }
}
And "inline" it works, it continues happily and leaves me with the correct iteration of i.
THIS however:
Thread().Run([=] {
for (int i = 0; i < grid.GetCount(); i++)
{
grid.GetRow(i).Bg(LtGray());
String item = grid(i,5);
if (ToUpper(TrimBoth(item)).StartsWith("SHIPPING"))
{
continue; // will be ignored for some reason *SHRUGS*
}
SQL * Select(SqlAll()).From(Whatever).Where(....);
if(SQL.Fetch()){//some if then elses again }
}
}
Just ignores the continue, sends an SQL query and as a result produces all kinds of errors
Worse:
correctly instead of a simple continue it holds a rowdelete
if (ToUpper(TrimBoth(item)).StartsWith("SHIPPING"))
{
grid.Remove(i);
i--;
continue;
}
works just nicely
if (ToUpper(TrimBoth(item)).StartsWith("SHIPPING"))
{
PostCallback([=] { grid.Remove(i); });
i--;
continue;
}
removes i-1 instead.
if there is i-1... if i was zero before I get Vcont.h line 84 Assertion Errors
of course (grid.Get(-1) crashes)
as if i is passed as a reference.
You see me completely baffled!
Ah well.. let's see if a while loop is more reliable inside the thread()...
Or do you have another idea?
that other german guy
[Updated on: Thu, 11 May 2017 20:19] Report message to a moderator
|
|
|
 |
|
Select Grid Row BY ID
By: germax on Fri, 05 May 2017 19:32
|
 |
|
Re: Select Grid Row BY ID
By: deep on Mon, 08 May 2017 15:07
|
 |
|
Re: Select Grid Row BY ID
|
 |
|
Re: Select Grid Row BY ID
By: germax on Wed, 10 May 2017 12:33
|
 |
|
Re: Select Grid Row BY ID
|
 |
|
Re: Select Grid Row BY ID
By: germax on Thu, 11 May 2017 03:33
|
 |
|
Re: Select Grid Row BY ID
|
 |
|
Re: Select Grid Row BY ID
By: germax on Thu, 11 May 2017 20:17
|
 |
|
Re: Select Grid Row BY ID
|
 |
|
Re: Select Grid Row BY ID
By: germax on Fri, 12 May 2017 02:20
|
 |
|
Re: Select Grid Row BY ID
|
 |
|
Re: Select Grid Row BY ID
By: germax on Sat, 13 May 2017 19:13
|
 |
|
Re: Select Grid Row BY ID
|
 |
|
Re: Select Grid Row BY ID
By: germax on Sun, 14 May 2017 19:48
|
 |
|
Re: Select Grid Row BY ID
By: JeyCi on Thu, 18 February 2021 14:45
|
 |
|
Re: Select Grid Row BY ID
By: JeyCi on Fri, 19 February 2021 07:31
|
 |
|
Re: Select Grid Row BY ID
By: deep on Mon, 15 May 2017 07:44
|
 |
|
Re: Select Grid Row BY ID
By: germax on Mon, 15 May 2017 14:22
|
Goto Forum:
Current Time: Sat May 10 23:14:24 CEST 2025
Total time taken to generate the page: 0.04403 seconds
|