QUOTE (littlebigfred @ Oct 27 2008, 02:09 PM) <{POST_SNAPBACK}>
Hello
After the user has double-clicked on a row in a NextGrid object, I display fields in a two-column grid in a modal form to let him make changes, and then go back to to the main form.
I'd like to display the original row selected, so that the user sees which row he selected before. This doesn't work:
Thank you.
After the user has double-clicked on a row in a NextGrid object, I display fields in a two-column grid in a modal form to let him make changes, and then go back to to the main form.
I'd like to display the original row selected, so that the user sees which row he selected before. This doesn't work:
CODE
procedure TForm1.Button2Click(Sender: TObject);
begin
for i := 0 to NextGrid1.RowCount - 1 do begin
if NextGrid1.Selected[i] then begin
Form2.ShowModal;
//Put focus back on selected row
//Doesn't work NextGrid1.Selected[i] := True;
Break;
end;
end;
end;
begin
for i := 0 to NextGrid1.RowCount - 1 do begin
if NextGrid1.Selected[i] then begin
Form2.ShowModal;
//Put focus back on selected row
//Doesn't work NextGrid1.Selected[i] := True;
Break;
end;
end;
end;
Thank you.
After doing the selection in code, I've found that I've had to do NextGrid1.Repaint;
What seems to be happening (in my case anyway) is that the row is getting selected in code, but not being shown as selected on screen until you force a repaint of the grid.
Hope that helps...



Find content
Not Telling
