We have a data grid view which we would like to apply a few conditional rules programmatically. We would still like the end user to be able to add their own conditional formatting rules, however; we would like to block them from deleting the rules that we added via code. Please see the attached screenshot for an example. How would I go about doing this?
For my first attempt I subscribed to the the ConditionalFormattingObjectList.CollectionChanging event. The problem is that the Action received in this event is all of type Reset first, Add second. Basically the ConditionalFormattingForm is first clearing the collection and then re-adding the all the conditions. Additionally, when you cancel the collection changing the UI still reflects the changes even though you have canceled the event in the underlying collection. Should I be using a different event. Perhaps one on the ConditionalFormattingForm itself?
Thank you,
-Chris
For my first attempt I subscribed to the the ConditionalFormattingObjectList.CollectionChanging event. The problem is that the Action received in this event is all of type Reset first, Add second. Basically the ConditionalFormattingForm is first clearing the collection and then re-adding the all the conditions. Additionally, when you cancel the collection changing the UI still reflects the changes even though you have canceled the event in the underlying collection. Should I be using a different event. Perhaps one on the ConditionalFormattingForm itself?
Thank you,
-Chris