How can I access the the rows selected in a WebDataGrid on the server side?

For example, I have a WebDataGrid and I've enabled the Selection behavior fot it. I want the user to be able to select a row in the WebDataGrid then click a button which calls server side code to process the selected row (i.e. getting the values of some of the columns of the selected row).

I think I need to use the SelectedRowsCollection somehow, but not sure how to use it with my WebDataGrid.

I'm one step closer, but I can't seem to read the records in the SelectedRows collection. Here's my sample code. When I run it, the selectedRow variable returns null. When I'm debugging, I do see one record selected in wdgFabric.Behaviors.Selection.SelectedRows.

With the following code behind in the button click
protected void Unnamed1_Click(object sender, EventArgs e)
{
foreach (GridRecord row in this.WebDataGrid1.Behaviors.Selection.SelectedRows)
{
if (row != null)
{
}
}
}
and the row was != null in my tests. Could you try a really small sample and see if it works for you?

I am encountering the same problem. The row is alway, in my case, Nothing. I can assure you that it is really frustrating to do something so simple when it isn't working. I hope you can find my problem.

I pass you the code behind:

Protected Sub lnkbtnEditar_Clicked(ByVal sender As Object, ByVal e As EventArgs) For Each row As GridRecord In WebDataGrid1.Behaviors.Selection.SelectedRows If Not (row Is Nothing) Then Dim iCount As Integer = row.Items.Count End If NextEnd Sub