GridViewCkecbox style

1 Answer 30 Views
GridView
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Deltaohm asked on 30 Apr 2024, 03:13 PM

Hi

In the image attached there are two columns of a radgridview, defined as follow:

<t:GridViewDataColumn										
				Header="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.SelectedColumnHeader }}"
				DataMemberBinding="{Binding IsSelected, Mode=TwoWay
								, UpdateSourceTrigger=PropertyChanged}">
				<t:GridViewDataColumn.CellTemplate>
								<DataTemplate>
									<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay
										, UpdateSourceTrigger=PropertyChanged}" />
								</DataTemplate>
				</t:GridViewDataColumn.CellTemplate>
</t:GridViewDataColumn>
<t:GridViewCheckBoxColumn
				AutoSelectOnEdit="True"
				Header="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.SelectedColumnHeader }}"
				DataMemberBinding="{Binding IsSelected, Mode=TwoWay
				, UpdateSourceTrigger=PropertyChanged}"/>
As you can see the 2 checkbox have different style: is possible to get the first one with the style of second one?

I need to use the first way, because I need to reflect the checking immediately, while the GridViewCheckBoxColumn seems to works only on lost focus.

Thank you
Luigi

1 Answer, 1 is accepted

Sort by
0
Accepted
Stenly
Telerik team
answered on 03 May 2024, 11:08 AM

Hello,

The observed behavior is expected with the GridViewCheckBoxColumn column. The bound property's value will be updated when the column goes out of edit mode.

With this in mind, the GridViewCheckBoxColumn creates a new GridViewCheckBox element internally, which by design, is intended for view-mode only. it does not support editing, so it cannot be used as an alternative to the native CheckBox element.

With this being said, what I could suggest would be to create a custom ControlTemplate for the native WPF CheckBox element, in order to achieve a similar look to the GridViewCheckBox element.

I hope the provided information will be of help to you.

Regards,
Stenly
Progress Telerik

A brand new ThemeBuilder course was just added to the Virtual Classroom. The training course was designed to help you get started with ThemeBuilder for styling Telerik and Kendo UI components for your applications. You can check it out at https://learn.telerik.com
Tags
GridView
Asked by
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Stenly
Telerik team
Share this question
or