How to bind a Collection<T> type in property Editor

Jun 20, 2011 at 6:43 AM

Hi Guys,

I have a variable data type having a name (string) and an ID (int) members. I want to bind a Variables (Collection<Variable>)  property of my ViewModel to Property Editor Control.

When I bind it then it shows the name of the type in a textbox. It should show a Combobox where I can choose a particular variable.

Please help me to solve this issue on ASAP basis...


Thanks in advance... :-)

Jun 22, 2011 at 8:48 AM
Edited Jun 22, 2011 at 8:49 AM

hi! can you show some code of what you are trying to do? In the following case you need to write a custom 'editor' (e.g. implemented as a ComboBox) for your Variable type:

public class YourViewModel {
  public string Name { get ...  set ... }
  public int ID { get ... set ... }
  public Variable Variables { get ... set ... }

See the CustomEditorDemo for an example on how to define a custom editor.