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

Apply style on GridViewCheckBox Column in RadGridView

6 Answers 132 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Omri
Top achievements
Rank 1
Omri asked on 05 Feb 2013, 05:32 PM
hello,

we have a RadGridView with some CheckBox columns defines as follows:

<telerik:RadGridView EditTriggers="CellClick" ItemsSource="{Binding Tickets">
    <telerik:RadGridView.Columns>
        <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsBooked}"/>
 <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsTaken}"/>
 <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsBusy}"/>
 <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsReady}"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>


I want to enable edit of all those columns in a single click.
I have managed to do so by setting each column with 

AutoSelectOnEdit="True" EditTriggers="CellClick"


However, when I try to apply them by style it doesnt work!

my style is defined as follows:
<Style TargetType="{x:Type telerik:GridViewCheckBoxColumn}">
    <Setter Property="AutoSelectOnEdit" Value="True"/>
    <Setter Property="EditTriggers" Value="CellClick"/>
</Style>


Please help!
Thanks, 
Omri.

6 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 05 Feb 2013, 05:45 PM
Hi Omri,

Generally, columns are not visual elements and should not define styles for them.  

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Omri
Top achievements
Rank 1
answered on 05 Feb 2013, 07:04 PM
Hi Maya,

Thank you for your answer. that is ok because as i mention I have found a workaround.
However, does it apply to the cells of the grid as well?

My entire purpose is to enter edit mode, change the value of the checkBox and exit edit mode all by a single click.

I've tried defining an event MouseUp and exit the edit mode in the event handler but it didn't work (I guess for the same reason ...)

Is there any other possible way to do that?

Thanks you,
Omri
0
Maya
Telerik team
answered on 06 Feb 2013, 07:42 AM
Hi Omri,

I am a bit confused. Why do you need to handle events or create style, rather than setting the required properties directly to the column ?  

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Omri
Top achievements
Rank 1
answered on 06 Feb 2013, 08:06 AM
I have no problem setting the required properties directly to the column, I just haven't found what I am looking for.

I'll try to explain it a bit more clearly.
I have RadGridView with multiple checkBox columns. 
I want to enable the user to change the value of the checkBox AND exit the edit mode all in a single click.
I have managed to enable changing of CheckBox in a single click by setting
AutoSelectOnEdit="True" EditTriggers="CellClick"

but that leaves the cell in edit mode, so its still not good enough.

How can I achive that by properties or any other way? 

Thanks,
Omri
0
Accepted
Maya
Telerik team
answered on 06 Feb 2013, 08:40 AM
Hi Omri,

Could you take a look at this article for a reference ? Does the second suggested approach correspond to your requirements ?  

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Omri
Top achievements
Rank 1
answered on 07 Feb 2013, 03:02 PM
Yes. It helped me solve my problem!

Thank you!
Tags
GridView
Asked by
Omri
Top achievements
Rank 1
Answers by
Maya
Telerik team
Omri
Top achievements
Rank 1
Share this question
or