I want to select a specific cell in TAdvStringGrid programmatically and have it respond with highlighting using the color set in Selection Color. This is what happens when I click in the cell. But, I need to have that happen by code selection. I can't seem to figure out how to do it, and I'm sure that I've done it before.
Thanks
Bob
grid.FocusCell(Col,Row);
That's not quite what's happening. I have the grid set to "look = glOffice2007" and the object inspector show the SelectionColor to be $005EC1F1, which is what the grid looks like if I click it with a mouse. Otherwise, the grid color is a light bluish grey, which I don't actually see anywhere in the object inspector default color boxes.
Some grids, however do show on startup the initial grid cell 0,0 to be this gold color. I don't see where this light grey color comes from. Your suggestion does cause the cell I specify to be this grey color. If I subsequently click on the cell, it does change from the light grey to gold.
procedure TForm3.Button1Click(Sender: TObject);
begin
AdvStringGrid1.FocusCell(2,2);
Advstringgrid1.SetFocus;
end;