Hi,
I have a check box column. I would like to select the rows when the user clicks on the checkbox.
Currently the rows are not gettting selected on when checkbox is checked. How to select multiple rows programmatically.
thanks,
I am setting the row.selected = true when the user clicks the check box. According to the documentations setting the Selected property adds the row to the SelectedRowCollections. So ideally this should select multiple rows in the grid.
Please let me know if this should work or not.
Thanks,
Swati
I don't think this is feasible. You are going to lose the selection if the user clicks on another row or attempts to edit another cell, for example.So as soon as the user clicks a checkbox in other row, you will lose the selection on any previously-selected rows. So you really cant use Selection for this.
If you want to highlight the checked rows, I recommend storing a list of rows yourself. Then in the InitializeRow event you can check if e.Row is on your list of Checked rows and if so, apply an Appearance to the row.