8/31/2023 0 Comments Change selected row in stringgrid![]() ![]() ![]() I need an event that will fire every time the currently selected row in the grid changes, for whatever reason, and never for any other reason. You can use a little trick to differentiate the selected row from all the other rows. ![]() Have the active row highlighted to enhance the user's experience: The OnDrawColumnCell event is used to handle the need for a customized drawing for the data in the cells of the grid. (BTW looking outside the grid by hooking various events in the data source or dataset has already been suggested to me, and it's not acceptable because other data-aware controls on the form can set them off. There's no need to click the grid to change the current record. There has to be some simple way to do this, and I just don't know enough about grids to figure it out off the top of my head. What do I need to do to get the same information (previous row # and new row #) if the user is moving up and down the list with the keyboard? It would be simple if there was an ActiveCell property, but I can't find one. I can override TCustomGrid.RowMoved, but it looks like that only gets called from a mouse event. I'm trying to write a TCustomDBGrid descendant that's designed to feel like a TListBox, and I need an event that will fire every time the user changes the active row. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |