Goal: I need be able to set the font size of a grid's cells at runtime based on user input.
Design: I have a user control with a telerik RadGrid on it. The grid has a mixture of datacolumns and imagecolumns. The user control exposes a property called FontSize.
Problem: I can't get Grid_CellFormatting to be hit once the FontSize Property is changed.
I need some way to force the grid to reformat all the cells when the FontSize Property is set.
I can mouse over the cells which causes Grid_CellFormatting to fire, at which time the cell font is updated with the new font size, but i need this to happen programatically.
My User Control:
I've tried adding me.grid.Update, Me.grid.Refresh after the My.settings.reload, but nothing seemed to trigger the CellFormatting event.
Your help is appreciated.
Thanks.
Design: I have a user control with a telerik RadGrid on it. The grid has a mixture of datacolumns and imagecolumns. The user control exposes a property called FontSize.
Problem: I can't get Grid_CellFormatting to be hit once the FontSize Property is changed.
I need some way to force the grid to reformat all the cells when the FontSize Property is set.
I can mouse over the cells which causes Grid_CellFormatting to fire, at which time the cell font is updated with the new font size, but i need this to happen programatically.
My User Control:
Private Sub Grid_CellFormatting(ByVal sender As Object, _ |
ByVal e As CellFormattingEventArgs) _ |
Handles grid.CellFormatting |
Dim f As New System.Drawing.Font("Arial", My.Settings.Grid_FontSize, _ |
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) |
e.CellElement.Font = f |
End Sub |
Public Property FontSize() As Single Implements IReportGridView.FontSize |
Get |
Return My.Settings.Grid_FontSize |
End Get |
Set(ByVal value As Single) |
My.Settings.Grid_FontSize = value |
My.Settings.Save() |
My.Settings.Reload() |
End Set |
End Property |
I've tried adding me.grid.Update, Me.grid.Refresh after the My.settings.reload, but nothing seemed to trigger the CellFormatting event.
Your help is appreciated.
Thanks.