We are trying to provide a feature to our users that will let them dynamically change the font size of the cells.
We have 3 radio buttons that let them select the size they would like (normal, small, extra small).
The suggested way I found on this forum was to use a style to set the font size. However styles can not be changed after being created, so we tried creating 3 styles and switching dynamically between them
The problem is that the grid does not refresh itself after the new style has been applied. We have turned off column virtualization but that did not effect anything.
Is there a way to refresh the grid after our styles have changed, or is there a better way to dynamically change the font size of the cells?
We have 3 radio buttons that let them select the size they would like (normal, small, extra small).
The suggested way I found on this forum was to use a style to set the font size. However styles can not be changed after being created, so we tried creating 3 styles and switching dynamically between them
<
Style
TargetType
=
"telerik:GridViewCell"
x:Key
=
"cellFontSizeNormal"
>
<
Setter
Property
=
"FontSize"
Value
=
"25"
/>
</
Style
>
<
Style
TargetType
=
"telerik:GridViewCell"
x:Key
=
"cellFontSizeSmall"
>
<
Setter
Property
=
"FontSize"
Value
=
"18"
/>
</
Style
>
....
switch
(size)
{
case
"Normal"
:
cellStyle =
this
.Resources[
"cellFontSizeNormal"
]
as
Style;
break
;
case
"Small"
:
cellStyle =
this
.Resources[
"cellFontSizeSmall"
]
as
Style;
break
;
case
"ExtraSmall"
:
cellStyle =
this
.Resources[
"cellFontSizeExtraSmall"
]
as
Style;
break
;
}
foreach
(var column
in
MyGrid.Columns)
{
column.CellStyle = cellStyle;
}
The problem is that the grid does not refresh itself after the new style has been applied. We have turned off column virtualization but that did not effect anything.
Is there a way to refresh the grid after our styles have changed, or is there a better way to dynamically change the font size of the cells?