Thread: DBgrid problem!
View Single Post
Old 07-30-2004, 06:06 AM   #1 (permalink)
Epohrolias
Registered User
 
Join Date: Jul 2004
Posts: 2
Epohrolias is on a distinguished road
DBgrid problem!

Hi Everybody,

First, sorry for my english...

I'm using a DBgrid.

The options are the following :

[dgTitles,dgColumnResize,dgColLines,dgRowLines,dgRo wSelect,dgConfirmDelete,dgCancelOnExit,dgMultiSele ct]

I'm trying to test if I find the record I select with this code (in a Button) :

Code:
bool record_found = false;

while(!DM->Query->Eof && !bool record_found)
{
     if(DBGrid->SelectedRows->CurrentRowSelected)
        {
            bool record_found = true;
        }
        DM->Query->Next();
}
(Query is the query object attached to the DBgrid)

But when I select the first row, that don't work...

I tried many thing since 2 hours and nothing seem to work : everytime, the first row don't seem to exist when I select it manually or not... (all other rows work propely)

Do anybody have a solution for this problem?

Thanks a lot...

Epoh

P.S. When I put the indicator to true, the "->" color is different when it's the first row...

P.S. I tried also "DBGrid->SelectedRows->Delete();" for deleting and even if I select only 1 row it delete ALL rows even if the "DBGrid->SelectedRows->Count" indicate that I selected only 1 row... Do these objects work propely or did I forget to do something?

Last edited by Epohrolias; 07-30-2004 at 07:04 AM.
Epohrolias is offline   Reply With Quote