Hi,I have a class with some properties that have to be bound to a XamDatagrid. That class also contains a property that returns a list of items. Let's call It 'ListOfItemProperty'. That property can't be static because I want to filter the list on other property values defined in the same instance. How can I bind a XamComboEditor's ItemsSource to the 'ListOfItemProperty' instance of the underlying object of the XamDataGrid?Greetings
Hello,
In this case I think it is best to use an Unbound Field like this:
<igDP:UnboundField BindingPath="ListProperty">
<igDP:UnboundField.Settings>
<igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}">
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igEditors:XamComboEditor}">
<Setter Property="ItemsSource" Value="{Binding DataItem.ListProperty}"/>
</Style>
</igDP:FieldSettings.EditorStyle>
</igDP:FieldSettings>
</igDP:UnboundField.Settings>
</igDP:UnboundField>
Hope this helps,
Alex.
Alex,It works on existing rows, but when i want to add a new row in the grid the underlaying dataitem doesn't exist yet? Whenever i fill another column first then the dataitem is constructed and it works fine.
I wonder if it might be better to bind directly to the datacontext which contains an list of those dataitems, but i don't know how to do that either. (the debug output says "can't find property")
Greetings
I suppose that the scenario is that each XamComboEditor in record has a different items collection and it is not the same.
If all the XamComboEditor have same values, you can use the example provided in the XamFeatureBrowser with a dynamic resource.
I know this is an old post and I apologize, but using the technique you suggested is causing our filter to list the valuepath instead of the displaymemberpath. It also sorts the column on valuepath and not the displaymemberpath.