Hi,
I use Property Grid control of a Extended WPF Toolkit Community Edition and need to show a list of accounts, loaded dynamically through a REST call. The Enum type shows well in the ComboBox editor while dynamic list does show type names instead of DisplayName of Item class. I used ItemsSourceAttribute and tried making Editor explicit through `[Editor(typeof(ItemsSourceAttributeEditor), typeof(ItemsSourceAttributeEditor))]` but both don't work.
A sample project is attached herewith. I have to use the SelectedObject as rest of the application is built like this.
Please advice.
Best,
Zeeshan Gulzar
Comments: ** Comment from web user: BoucherS **
I use Property Grid control of a Extended WPF Toolkit Community Edition and need to show a list of accounts, loaded dynamically through a REST call. The Enum type shows well in the ComboBox editor while dynamic list does show type names instead of DisplayName of Item class. I used ItemsSourceAttribute and tried making Editor explicit through `[Editor(typeof(ItemsSourceAttributeEditor), typeof(ItemsSourceAttributeEditor))]` but both don't work.
A sample project is attached herewith. I have to use the SelectedObject as rest of the application is built like this.
Please advice.
Best,
Zeeshan Gulzar
Comments: ** Comment from web user: BoucherS **
Hi,
You don't need the attribute :
```
[Editor(typeof(ItemsSourceAttributeEditor), typeof(ItemsSourceAttributeEditor))]
```
In AccountsItemSource.GetValues(), instead of doing :
```
c.Add(new Item { DisplayName = "Account-1",Value="Account-1" });
c.Add(new Item { DisplayName = "Account-2", Value = "Account-2" });
```
try with this :
```
c.Add( "Account-1", "Account-1" );
c.Add( "Account-2", "Account-2" );
```
where the first parameter is the value and the second parameter the displayName.
――――
_Get more controls, features, updates and technical support with [Xceed Toolkit Plus for WPF](https://wpftoolkit.codeplex.com/wikipage?title=Compare%20Editions)_