Hi, I need to create template column programmatically. Is it possible to create template column programmatically without using XmlReader? I need event handler for template column control. So I don’t prefer XmlReader.
Hi Stephen,
In the CellControlAttached event, I can get the handle of the ItemTemplate control but not the EditorTemplate control. How do I attach an event to the latter?
Thank you
Thank you.
Hi,
So, the only other way would be to predefine the DataTemplate in a Resource Dictionary. However, this won't help with your EventHandler issue.
The best way to approach this would probably be through commands or bindings with converters.
However if thats not an option, i suppose you could use the CellControlAttached event and get a handle of the control and add an event handler.
Note: the grid recycles all elements, so you should make sure to always unhook the event handler before attaching a new one.
-SteveZ