So I have the following XamDataGrid
Each Combo contains a list of names and nicknames. what I need to do is when I select the nickname, the name gets selected automatically, and vise versa. So the selection of one needs to be attached to the other.
Does anyone have any idea how I can achieve that?
<igWPF:XamDataGrid x:Name="xamDataGrid" DataSource="{Binding Path=Acc_Links}"> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings SelectionTypeRecord="None" SelectionTypeField="None" SelectionTypeCell="None" AutoGenerateFields="False" HeaderPrefixAreaDisplayMode="None" RecordSelectorLocation="None" > </igDP:FieldLayoutSettings> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:ComboBoxField Name="Account_Title" Label="Title" ItemsSource="{Binding Source={StaticResource Titles}}" DisplayMemberPath="Account_Title" /> <igDP:ComboBoxField Name="Nickname" Label="Nickname" ItemsSource="{Binding Source={StaticResource Titles}}" DisplayMemberPath="Nickname" /> <igDP:ComboBoxField Name="fullname" Label="fullname" ItemsSource="{Binding Source={StaticResource Titles}}" DisplayMemberPath="fullname" /> <igDP:Field Label="Percent" BindingType="UseAlternateBinding" AlternateBinding="{Binding Path=Percent}" HorizontalContentAlignment="Right"> <igDP:Field.Settings> <igDP:FieldSettings Width="Auto" AllowEdit="True" /> </igDP:Field.Settings> </igDP:Field> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igWPF:XamDataGrid>
Thank you sooooo much! You practically saved my career
Hello Nour,
I have been investigating into the behavior you are looking to achieve, and in order to do this, I would recommend handling the DataValueChanged event of the XamDataGrid. Please note that in order to handle this event, you need to opt into it by setting the XamDataGrid.FieldSettings.DataValueChangedNotificationsActive property to true.
The event arguments of the DataValueChanged event can net you the Record that has had a change as well as the Field that the value change is associated with. From this information, you can get the underlying data item from the record, and change the properties as needed.
I am attaching a sample project to demonstrate the above.
Please let me know if you have any other questions or concerns on this matter.
XDGComboDependentValues.zip