Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Grouping in XamDataGrid displays Id
posted

I have a XamDataGrid with a XamComboEditor set as one of the fields, the item-source for this field is a list of objects with a enum as the id and a string as the name.

When the XamDataGrid is gruoped by this field it displays the id as the fieldname instead of the name.

What's really weird is that if I reload the item-source the name is displayed correctly.

<igDP:ComboBoxField Name="field" Label="fieldLabel" Width="200" DisplayMemberPath="Name" ValuePath="Id" DropDownButtonDisplayMode="OnlyInEditMode">
	<igDP:ComboBoxField.EditorStyle>
		<Style TargetType="{x:Type igEditors:XamComboEditor}" BasedOn="{StaticResource XamComboEditorStyle}">
			<Setter Property="ItemsSource" Value="{Binding Path=DataContext.SelectableValues, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
		</Style>
	</igDP:ComboBoxField.EditorStyle>
</igDP:ComboBoxField>

public List<SelectableValuesViewModel> SelectableValues
        { get; set; }


public class SelectableValuesViewModel
	{
		public EnumType Id
		{ get; set; }

		public string Name
		{ get; set; }

		public SelectableValuesViewModel(EnumType id, string name)
		{
			this.Id = id;
			this.Name = name;
		}
	}