I’ve found a problem in the DataGridView.SelectedRows property. In the attached example, if you select all the rows (10 in total), then press that button to get the number of selected rows, you will see a 10 displayed, which at that point is correct. If you then select just one row then press that button again, it still says that there are 10 rows selected.
Also, I noticed that if i setup a foreach loop over the SelectedRows after selecting one row at a time, e.g. rows 1,3 and 6, with row 6 being the only row selected, the SelectedRows property will show that there are 3 rows still selected when there is only the one. This problem also occurs using a for loop over the grid.Rows property, i.e. it retains the previously selected rows when there is only 1 row selected.
Thanks, both issues are fixed in the release build coming up later today.
Recognized the same issue after updating to Version 220.127.116.11. I use “MultiSelect = False” on grid but every row I’ve clicked is marked as “Selected = True” and the property doesn’t change to “False” any more.
private void dgvEMails_SelectionChanged(object sender, EventArgs e)
Wisej.Web.DataGridView grid = (Wisej.Web.DataGridView)sender;
Wisej.Web.DataGridViewRow row = grid.SelectedRows;
EmailMessage msg = (EmailMessage)row.DataBoundItem;
htmlPanel.Html = msg.Body;
For “Singleselect” I changed my code from
“Wisej.Web.DataGridViewRow row = grid.SelectedRows;”
“Wisej.Web.DataGridViewRow row = grid.CurrentRow;”
Please login first to submit.