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

Checkbox column in gridview

1 Answer 159 Views
GridView
This is a migrated thread and some comments may be shown as answers.
jayanthi
Top achievements
Rank 1
jayanthi asked on 12 Aug 2010, 09:31 AM
Hello,

Am using windows, vb.net
I have checkboxcolumn in Radgridview. Am displaying BIT field from database which is displayed as checkbox in gridview in 3rd column, and first & second columns values cannot be edited.
I have the following problems;

  1. Only one checkbox has to be check at a time. If i select a check box then previously selected check box has to uncheck.
  2. If i press down or up arrow key, then check state of the check box has to be changed.

It's an urgent requirement, awaiting for the team to help me

Thanx
Jayanthi

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 17 Aug 2010, 05:09 PM
Hello jayanthi,

Thank you for writing.

Please take a look at the following KB article which illustrates how to check only one check box in a column.

As to your second question, you can replace the default grid behavior with a custom one, which overrides the ProcessKey method to implement the required custom logic:
Private Sub Form1_Load(sender As Object, e As EventArgs)
  
    Me.radGridView1.GridBehavior = New CustomGridBehavior()
End Sub
  
Public Class CustomGridBehavior
    Inherits BaseGridBehavior
    Public Overrides Function ProcessKey(keys__1 As KeyEventArgs) As Boolean
  
                'do something
        If keys__1.KeyCode = Keys.Up OrElse keys__1.KeyCode = Keys.Down Then
        End If
        Return MyBase.ProcessKey(keys__1)
    End Function
End Class

I hope this helps. Let me know if you have any additional questions.

Best wishes,
Martin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
jayanthi
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or