View Full Version : DataGrid: Highlight Selected Row
pakapaka
07-07-2008, 04:18 AM
Dear All
I have a tree object and a datagrid object.
When I select a node from the tree, the data in the DataGrid plugin is automatically updated. How do highlight a specific default row in the Datagrid plugin when the data is refreshed (without performing a mouse over)
Thanks
Pakapaka
RizlaUK
07-07-2008, 06:34 AM
you can use Grid.SetSelectedRange to set the selected item
and use Grid.EnsureVisible to make sure the selected item is visable in the grid
pakapaka
07-07-2008, 07:24 AM
Thanks but I should clarify
....when I select a random tree node, the data is refreshed in the Datagrid AND the first row in the Datagrid is automatically selected. However I need to have the first row HIGHLIGHTED whenever I select a different tree node
Correct me if am wrong, but the Ensure.Visible command only makes sure I dont have to scroll up or down to see the row, it does not HIGHLIGHT the row
Yours
Pakapaka
RizlaUK
07-07-2008, 09:48 AM
no it dose not, thats just to make sure its visable as i dident know you want to select the first row
Grid.SetSelectedRange sets the selected/highlighted item or range of items,
to select the 1st item use
Grid.SetSelectedRange("Grid", 1, 0, 1, 0, true, true);
and to highlight all cell's in the row set the grid to list mode
Grid.SetListMode("Grid", true);
pakapaka
07-07-2008, 10:09 AM
...yep, that does it . Thanksssss
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.