Home All Groups Group Topic Archive Search About

Determine Selected Rows in DataGrid C#

Author
18 Jan 2005 11:50 AM
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
Author
18 Jan 2005 1:42 PM
Ritesh Jain via DotNetMonster.com
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

--
Message posted via http://www.dotnetmonster.com

Bookmark and Share