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

How to keep checkbox column in edit mode?

1 Answer 150 Views
GridView
This is a migrated thread and some comments may be shown as answers.
kj
Top achievements
Rank 1
kj asked on 08 Aug 2010, 04:34 PM
Hi,

My RadGridView is binding to a DataTable, and one column is boolean checkbox. I have to click the chechbox for several times to enable to edit it, how do I solve this problem?

<Window x:Class="Window1"
    Title="Window1" Height="300" Width="300" xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView">
    <Grid>
        <my:RadGridView Name="RadGridView1" />
    </Grid>
</Window>
Class Window1 
  
    Public Sub New()
  
        InitializeComponent()
  
  
        Dim dt As New System.Data.DataTable
        dt.Columns.Add("hide", GetType(Boolean))
        dt.Columns.Add("highlight", GetType(String))
        dt.Columns(0).DefaultValue = True
        dt.Columns(0).ReadOnly = False
  
        dt.Columns(1).DefaultValue = "test"
        dt.Columns(1).ReadOnly = True
  
        Dim row1 As System.Data.DataRow = dt.NewRow
        row1("hide") = True
        row1("highlight") = "A"
        dt.Rows.Add(row1)
  
        Dim row2 As System.Data.DataRow = dt.NewRow
        row2("hide") = True
        row2("highlight") = "B"
        dt.Rows.Add(row2)
        RadGridView1.ItemsSource = dt
    End Sub
End Class

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Aug 2010, 06:53 AM
Hello,

 You can create your own column with desired CellTemplate (in your case CheckBox) or you can use the approach demonstrated in this blog post (override CreateCellElement). 

Kind regards,
Vlad
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
kj
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or