Topic: table grid problem

sorry but i have a problem with table grid and ComboBox.
with this code :

procedure Ordine_grid_prodotto_OnCellClick (Sender: string; ACol, ARow: Integer);
begin
   Ordine.cb_codProdotto.ItemIndex := ARow +1;
end;

when click row on table grid named  grid_prodotto (in Ordine form)  the row number could copy in ComboBox named cb_codProdotto, used as index.
The code run well, but if i search code with text box and search button or if order columns in table grid pressed head on grid,  the index value is wrong ... the index value is not the new ordered index, but the old not ordered.

I want click on table grid row and want to automatically copy the record index in ComboBox

Thank's

Post's attachments

Attachment icon right_wrong.jpg 81.76 kb, 389 downloads since 2014-06-14 

Re: table grid problem

Hello,

procedure Ordine_grid_prodotto_OnCellClick (Sender: string; ACol, ARow: Integer);
begin
   Ordine.cb_codProdotto.dbItemID := Ordine_grid_prodotto.dbItemID;
end;
Dmitry.

Re: table grid problem

thank's ... it work very well

very thank s