Are you asking how to determine which rows have a certain column value that
is checked in the DataGrid? If so then I assume that the column is bound to
boolean column in the underlying DataTable. So just loop through this
column, in the DataTable, looking for "True" fields.
' This code assumes that you have bound a DataTable to the DataSource of a
DataGrid.
' This code also assumes that there is a column named "Bool" that is of type
Boolean.
' This code ensures that in a tri-state check scenario the "Indeterminate"
state is ignored.
Dim dt As DataTable = DirectCast(Me.DataGrid1.DataSource, DataTable)
For Each row As DataRow In dt.Rows
Dim obj As Object = row("Bool")
If (TypeOf obj Is Boolean) Then
If (DirectCast(obj, Boolean) = True) Then
' Get ID here.
' Example, Dim id As String = DirectCast(row("GUID"), String)
End If
End If
Next
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.