Hey, how can I skip the ViewCellFormatting event while the grid is getting new data?
Maybe there's some property I can check before continuing formatting? I have two interdependent grids and would like to "pause" this event whenever any of them is reloading...
1 Answer, 1 is accepted
Hi, Jure,
The easiest approach is to unsubscribe from the ViewCellFormatting event before the action for reloading and subscribe back to the event after the action is completed.
Please give it a try and see how it works on your end. I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
I know this is not Telerik specific but is it possible to remove the handler without specifying the concrete event? What I mean something like (without AddressOf):
RemoveHandler grid.ViewCellFormatting '???
Private Sub form_BeforeLoad(grid As RadGridView) Handles form1.BeforeLoad, form2.BeforeLoad
RemoveHandler grid.ViewCellFormatting, AddressOf grid_ViewCellFormatting
End Sub
Private Sub form_AfterLoad(grid As RadGridView) Handles form1.AfterLoad, form2.AfterLoad
AddHandler grid.ViewCellFormatting, AddressOf grid_ViewCellFormatting
'trigger the ViewCellFormatting event ??
grid.Invalidate()
End Sub
To force firing the ViewCellFormatting event, you can just refresh the master template by calling the MasterTemplate.Refresh method.