This is a migrated thread and some comments may be shown as answers.

Count total checked values from checkbox column of RadGridView ?!

2 Answers 330 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dipan
Top achievements
Rank 1
Dipan asked on 01 Oct 2017, 06:58 PM

Count total checked values from checkbox column of RadGridView ?!

seems very east stuff but dont know why telerik does not support like normal gridview !! strange but true !

Regards,

Dipan Chikani

2 Answers, 1 is accepted

Sort by
0
Nandan
Top achievements
Rank 1
Iron
Iron
Iron
answered on 14 Nov 2022, 05:24 AM

Hi dipan

I can give u some idea how to do in radgridview

  Private Sub CountCheckedRows()
        Dim iCount As Integer = 0
        For i = 0 To Me.dgvBhukaBag.MasterTemplate.DataView.ItemCount - 1
            If Not IsDBNull(Me.dgvBhukaBag.Rows(i).Cells(0).Value) Then
                If Me.dgvBhukaBag.Rows(i).Cells(2).Value = True Then iCount += 1
            End If
        Next
        MessageBox.Show("Checked CheckBox: " & iCount)
    End Sub

 

You can do some modification according to your needs.

Thanks & Regards

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 14 Nov 2022, 05:32 AM

Hi, Nandan. Thank you for sharing your solution with the community. I would recommend you to use the RadGridView.Rows collection for iterating the records inside the grid. Then, indeed, it is necessary to check the respective cell's value and see whether it is toggled.
0
Nandan
Top achievements
Rank 1
Iron
Iron
Iron
answered on 14 Nov 2022, 05:53 AM

Hi Dipan

 

Private Sub CountCheckedRows()

 For Each row As GridViewRowInfo In dgvBhukaBag.Rows
            If row.Cells(0).Value = True Then
                iCount += 1
            End If
        Next

        MessageBox.Show("Checked CheckBox: " & iCount)

End Sub

 

 

Regards

Nandan

 

 

Tags
GridView
Asked by
Dipan
Top achievements
Rank 1
Answers by
Nandan
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or