Hello!
I would like to style a GridViewCheckBoxColumn triggered if the CheckBox is readonly or not. The differense between true and false is to small.
Any Ideas?
Best regards / Anna
I would like to style a GridViewCheckBoxColumn triggered if the CheckBox is readonly or not. The differense between true and false is to small.
<
telerik:GridViewCheckBoxColumn
Header
=
"Klart"
DataMemberBinding
=
"{Binding ChKlar, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsReadOnlyBinding
=
"{Binding Uppdaterbar, Mode=OneWay}"
EditTriggers
=
"CellClick"
AutoSelectOnEdit
=
"True"
/>
Any Ideas?
Best regards / Anna
5 Answers, 1 is accepted
0
Hello Anna,
Actually IsReadonlyBinding does not affect directly the GridViewCheckBox's appearance, this property does not allow you to go into edit mode. I strongly recommend you to review this topic, the approach is the same in WPF, Configure CheckBox as GridViewCheckBox. You can change this behavior in IsReadOnly through edit the template of GridViewCheckBox and adding some custom behavior in your own trigger to handle this case.
Please let me know if you need any further assistance.
Greetings,
Vanya Pavlova
the Telerik team
Actually IsReadonlyBinding does not affect directly the GridViewCheckBox's appearance, this property does not allow you to go into edit mode. I strongly recommend you to review this topic, the approach is the same in WPF, Configure CheckBox as GridViewCheckBox. You can change this behavior in IsReadOnly through edit the template of GridViewCheckBox and adding some custom behavior in your own trigger to handle this case.
Please let me know if you need any further assistance.
Greetings,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Rudis
Top achievements
Rank 1
answered on 23 Nov 2010, 12:43 PM
But I can´t see that GridViewCheckBox has a IsReadOnly property to trigger on? Could you please send me an example.
Best regards,
Anna
Best regards,
Anna
0
Hi Anna,
With my colleague Yavor we have created a project that illustrates this approach. The IsReadOnlyBinding property of GridViewCheckBoxColumn is bound to the boolean IsActive property of the underlying object. Within the RadGridView's CellLoaded event we perform a checking for that value and the corresponding style for GridViewCheckBox is returned. If you want to change the value in all editable GridViewCheckBox to True just refresh the items.
Please see the attached project and if you need any further assistance let me know.
Greetings,
Vanya Pavlova
the Telerik team
With my colleague Yavor we have created a project that illustrates this approach. The IsReadOnlyBinding property of GridViewCheckBoxColumn is bound to the boolean IsActive property of the underlying object. Within the RadGridView's CellLoaded event we perform a checking for that value and the corresponding style for GridViewCheckBox is returned. If you want to change the value in all editable GridViewCheckBox to True just refresh the items.
Please see the attached project and if you need any further assistance let me know.
Greetings,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Rudis
Top achievements
Rank 1
answered on 23 Nov 2010, 07:06 PM
Ok, so the only way is to use the CellLoaded event? Personally I really don't like this solution. But if its the only way to make them look different...
I´m curious, why have you made the states look the same? Why is the CheckBox not "disabled-looking" when it is readonly?
Best regards,
Anna
I´m curious, why have you made the states look the same? Why is the CheckBox not "disabled-looking" when it is readonly?
Best regards,
Anna
0
Hello Anna,
Vanya Pavlova
the Telerik team
The GridViewCheckBox is gray colored by design, actually internally cannot trigger IsReadOnly property, because it is very basic and lightweight alternative of the standard CheckBox. Retemplating procedure of a CheckBox is not a trivial task and some issues that you might have can be reduced using GridViewCheckBox in different scenarios in our RadGridView.
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF