I'm using the XamDataGrid to show and change my hierarchical business objects.
One of my fields looks like this:
<igDP:UnboundField Name="Size" Label="My Size" x:Name="fldSize" Width="Auto"> <igDP:UnboundField.Settings> <igDP:FieldSettings AllowEdit="False" EditorType="{x:Type igEditors:XamTextEditor}"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="Value"> <Setter.Value> <MultiBinding Converter="{StaticResource SizeToDimensionsStringMultiConverter}"> <Binding Path="Record.DataItem.Size.Width" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type igDP:DataRecordCellArea}}"/> <Binding Path="Record.DataItem.Size.Height" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type igDP:DataRecordCellArea}}"/> </MultiBinding> </Setter.Value> </Setter> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:UnboundField.Settings> </igDP:UnboundField>
If I scroll through my data records (vertical direction) randomly the value (e.g. Size) of some records is beeing set although I haven't changed anything.
How is this possible? What can I do to stop this behaviour?
Hello Darius,
I have been looking into the modified sample an I can say that you can set the UnboundField's DataType Property to your interface (IComplex), too, no matter it doesn't show in the XAML's itelisence.
Hope this helps you.
Hello Stefan,
your solution works great if I know the Datatype but in my case I have an interface. I changed the type of the ObservableCollection from Complex to IComplex (See attached sample). How can I set the DataType to an interface type?
Sincerely,
Darius Geiß
I have modified the sample you sent me, so now it works as you want. Basically I overridden the Complex class Equals method and set the UnboundField’s DataType to be Complex. Also I made the two collections used for the Combo’s Source and Column45’s Value to be the same, because the one was “One” and the other “One!”.
The video.
Hi,
it took some time to create the example.
The example is based on the XamDataGridPerformance I found in this forum. We removed all columns and added two new ones.
If all values of the XamComboEditor are the same for all records, scrolling is no problem. The problem appears if at leats one of the values in the XamComboEditor differs for the other values.
I will add a video that shows the issue with the next post.
Darius
Btw: I had to remove the infragistic dlls from the solution folder.