Determine Selected Rows in DataGrid C#

  • Thread starter Thread starter Clive Godden
  • Start date Start date
C

Clive Godden

Does anyone have any C# code snippet for iterating thro a datagrids rows and
getting the values of the rows that have been selected
 
Hi,
Actually u didn't mention what u mean by Selected Rows.........is there is any check box column in Grid to select COlunms or u wan a all the records that are selected through COntrol Key...........

Here i have code through which u can access multiple selected Rows of Grid.......

Dim int As Integer
For int = 0 To BindingContext(dgData.DataSource).Count - 1
If (dgData.IsSelected(int)) Then
MessageBox.Show(dgData.Item(int, 1))
End If

Next


I hope this will help u.............

Reagrds,
Ritesh
 
Back
Top