User (Old forums)MemberJune 6, 2007 at 5:38 amPost count: 23064
I need assign the CellEditor from a Column programmatically in runtime with C#. This is what I tried:
Binding bInterneBez = new Binding(“InterneBezeichnung”);
Column colInterneBez = new Column(“InterneBezeichnung”, “InterneBezeichnung”, bInterneBez);
colInterneBez.CellEditor = new CellEditor();
colInterneBez.CellEditor.EditTemplate = new DataTemplate(typeof(ComboBox));
DataTemplate dt = new DataTemplate(typeof(ComboBox));
I can only pass the type of the CellEditor to the DataTemplate but no further information. How would I realize the example in your documentation from the CellEditor Class? How do i just get a ComboBox instead of the TextEditor in the Column?
Thanks in advance
Imported from legacy forums. Posted by Ralf (had 2963 views)User (Old forums)MemberJune 7, 2007 at 1:51 pmPost count: 23064
For the community (got the answer from Xceed by mail)… Basically this is how it can be done:
DataTemplate template = new DataTemplate();
FrameworkElementFactory factory = new FrameworkElementFactory( typeof( ComboBox ) );
template.VisualTree = factory;
CellEditor.EditTemplate = template;
Imported from legacy forums. Posted by Ralf (had 426 views)User (Old forums)MemberJune 8, 2007 at 2:03 pmPost count: 23064
I’ve used this type of method but the problem is that it does not bind correctly to grid…the drop down shows but it does not update the grid column to the newly selected value and the drop initially show up blank.
I set my data source using the following:
not sure how to setup so the the combo updates parent column…any ideas?
Imported from legacy forums. Posted by Adrian (had 427 views)Xceed SupportMemberJune 14, 2007 at 8:27 amPost count: 5658
You have to use a CellEditorBindingExtension to bind a CellEditor to the Cell’s value.
refer to this post for details:
Imported from legacy forums. Posted by Marcus [Xceed] (had 3863 views)
- You must be logged in to reply to this topic.