Hi folks,
using 11.2
I have some buttons on my web form, one of them sets the SelectedRowCollection, the following code snippet should explain.
Dim selectedRows As SelectedRowCollection = webdatagrid1.Behaviors.Selection.SelectedRows selectedRows.Clear() selectedRows.Add(data_grid1.Rows(0))After this code snippet I want to call the RowSelectionChanged property, as it isn't firing on the selectedRows.Add event.Is there a way to call the webdatagrid1.RowSelectionChanged event?
Hi Daryl007,
You can achieve this using something like the following code:
Protected Sub Button2_Click(sender As Object, e As EventArgs) Dim currentlySelectedRows As SelectedRowCollection = WebDataGrid1.Behaviors.Selection.SelectedRows Dim newSelectedRows As New SelectedRowCollection(WebDataGrid1) newSelectedRows.Add(WebDataGrid1.Rows(1)) Dim eventArgs As New SelectedRowEventArgs(currentlySelectedRows, newSelectedRows) currentlySelectedRows.Clear() currentlySelectedRows.Add(newSelectedRows(0)) WebDataGrid1_RowSelectionChanged(WebDataGrid1, eventArgs)End Sub
Let me know if this helps.
Using your sample as a guideline, I ALMOST have it working.
However, the issue that remains is that the new row is not physically selected or "high-lighted", so that if I do click on another row, the rowchangeevent fires again, but with the incorrect information.
Any clues?