We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Progarmically select a row in a static grid

Hi, I have made a grid like a list by setting ListBoxSelectionMode = SelectionMode.One. If all cells are static type, how can I select a row programmically (mimic clicking on row header). In a case like this, clicking any static cell will still highlight the row, but CurrentCell's RowIndex is still -1. Thanks! James

3 Replies

AD Administrator Syncfusion Team October 13, 2003 06:10 PM UTC

You can call model.Selections.SelectRange(GridRangeInfo.Row(rowIndex), true); Stefan

JA James October 15, 2003 12:42 PM UTC

It does select the first row with some side effect. It set the foucs on first static column (the cell's color changed to white). How to get ride of that? Thanks!

AD Administrator Syncfusion Team October 15, 2003 02:56 PM UTC

Try handling the CurrentCellActivating event, and in your handler, set e.ColIndex = 0.

Live Chat Icon For mobile
Up arrow icon