This is working as expected, now I want to add a "Reset" button, when I click on it I would like to reset or remove the format of all the cells that have been changed, how can I accomplish this?
5 Answers, 1 is accepted
Dess | Tech Support Engineer, Principal
answered on 06 Jul 2017, 10:09 AM
Thank you for writing.
The CellFormatting event is the appropriate place to customize grid cells according to some custom criteria. If you need to reset all styles that are already applied, it is necessary to clear the Tag property for all the rows. Then, in order to force the CellFormatting event to be fired and apply the correct style, you can call the Refresh method of the MasterTemplate.
I hope this information helps. Should you have further questions I would be glad to help.
Due to the UI virtualization in RadGridView, cell elements are created only for currently visible cells and are being reused during operations like scrolling, filtering, grouping and so on. In order to prevent applying the formatting to other columns' cell elements (because of the cell reuse), all customization should be reset for the rest of the cell elements which actually the GridViewCellEventArgs .CellElement.ResetValue method does.
I hope this information helps.
Dess | Tech Support Engineer, Sr.
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.