I have a RadGridView that's bound to the DataView of a DataTable. Whenever the underlying database table contains a boolean column, RadGridView appropriately (and automatically) renders that column using a GridViewCheckBoxColumn. However, by default, it takes 3 mouse clicks to modify the value of any given checkbox. I've read the help topics on reducing the click count to either 2 clicks or 1 click.
I'd like to start by setting the EditTriggers property for every GridViewCheckBoxColumn to "CellClick" - which according to the docs should reduce my click count to 2. However, I'm not sure of the appropriate place to make that adjustment. I assumed that from within the AutoGeneratingColumn event handler, I could detect the current column was a GridViewCheckBoxColumn and simply set the property there.
However, examining the arguments passed into that method (the RadGridView itself and a GridViewAutoGeneratingColumnEventArgs object), I didn't see anything which indicated the current column was a GridViewCheckBoxColumn.
I know I can *create* my own, new GridViewCheckBoxColumn from within that event handler, but is that really necessary since it already exists? Also, in order to create my own column, I'd need to know that the current db column is indeed a Boolean (by *type*, not by field name) - which I haven't found a way to determine from within the event handler either.
I also tried to add the following Style to the view's XAML, but it didn't seem to have any effect:
Note that I am using implicit styles that can be changed at runtime - in case that impacts the validity of the above style setting...
So, what's the best way to set the EditTriggers property on an AutoGenerated column?
Thanks,
Jeff
I'd like to start by setting the EditTriggers property for every GridViewCheckBoxColumn to "CellClick" - which according to the docs should reduce my click count to 2. However, I'm not sure of the appropriate place to make that adjustment. I assumed that from within the AutoGeneratingColumn event handler, I could detect the current column was a GridViewCheckBoxColumn and simply set the property there.
However, examining the arguments passed into that method (the RadGridView itself and a GridViewAutoGeneratingColumnEventArgs object), I didn't see anything which indicated the current column was a GridViewCheckBoxColumn.
I know I can *create* my own, new GridViewCheckBoxColumn from within that event handler, but is that really necessary since it already exists? Also, in order to create my own column, I'd need to know that the current db column is indeed a Boolean (by *type*, not by field name) - which I haven't found a way to determine from within the event handler either.
I also tried to add the following Style to the view's XAML, but it didn't seem to have any effect:
<
UserControl.Resources
>
<
ResourceDictionary
>
<
Style
TargetType
=
"telerik:GridViewCheckBoxColumn"
>
<
Setter
Property
=
"EditTriggers"
Value
=
"CellClick"
/>
</
Style
>
</
ResourceDictionary
>
</
UserControl.Resources
>
Note that I am using implicit styles that can be changed at runtime - in case that impacts the validity of the above style setting...
So, what's the best way to set the EditTriggers property on an AutoGenerated column?
Thanks,
Jeff