Has anyone ever encountered a situation similar to the following.
I have a Class MyData that contains BindingList<referenceData> and BindingList<PrimaryData>
A datagrid that is bound to BindingList<PrimaryData> is presenting a column as a combobox - the ComboBoxItemsProvider.Itemssource is bound to a BindingList<referenceData>.
When the form is constructed, an instance of MyData is created, both binding lists are created (count = 0) and the bindings are established (Datasource and itemSource).
Then upon a user action, the MyData.ReferenceData binding list is populated. The userInterface properly reflects this and the dropdown (in the addnewrow) now contains the appropriate reference data.
BUT, If I select a value from the drop down, and tab to the next field in the datagrid, the cell no longer contains a value (its blank).
Furthermore, if a user action then causes the Mydata.PrimaryData list to be populated, the Datagrid now reflects the records that were added to the class. but the same behavior still exists when a combo item is selected and tabbed off of.
to add to the confusion - If the MyData instance is populated with both ReferenceData and PrimaryData - then the bindings occur (datasource and itemsource) Everything works correctly!
This senario is encountered in 2 places deep within our complete application. I have been unable to reproduce it in a simple application - so i havent included one (I will keep trying).
Could anyone provide some guidance or thoughts as to what may be happening here.
Thanks in Advance
Thank you for posting the requested information. Just as you stated, the problem doesn't manifest itself in a smaller isolated sample. I tried a couple different things to see if I could replicate the problem with no luck.
On the plus side, at least you have a workaround for the time being. If you have any more information you would like to pass on, please post it.
Sam - I verified that the types were the same. to add to the complexity - both the Primary data and the referenceData are defined as BindingList<refdata> or BindingList<primarydata> . I still have not been able to reproduce in a simple application. We have been able to remedy the situation by breaking out out data (reference used to be within primary) and specifically calling the initialize Drop down code only after the refData binding list contains items. It may have been something on our side...
Primary Data property is defined
public
class PrimaryData : INotifyPropertyChanged
string reportGrade { get; set; }
ReferenceData is:
class ReferenceData
string variable { get; set; }
XAML:
<
igDP:XamDataGrid.Resources>
<igEditors:ComboBoxItemsProvider x:Key="ReportGradeItemsProvider" ValuePath="variable" DisplayMemberPath="variable" />
<Style x:Key="ReportGradeFieldStyle" TargetType="{x:Type igEditors:XamComboEditor}">
<Setter Property="ItemsProvider" Value="{StaticResource ReportGradeItemsProvider}" />
</Style>
</igDP:XamDataGrid.Resources>
......
igDP:Field Name="reportGrade" Label="Report Grade">
<igDP:Field.Settings>
<igDP:FieldSettings EditorStyle="{StaticResource ReportGradeFieldStyle}" CellWidth="150" LabelWidth="150" />
</igDP:Field.Settings>
</igDP:Field>
Hi,
The only time I have experience something similar to your issue is when there is a mismatch between the type of the Field object's value and the type of the editor's value. The data type of the property you set as the ComboBoxItemsProvider.ValuePath property must match the data type of the field.
For example, if the ComboBoxItemsProvider object's ValuePath property references a string property in your referenceData class, but the Field object's data type is an integer, the selected value in the xamComboEditor control will get cleared out if the string value cannot be converted to an integer.
If you still have problems after setting the ValuePath and DisplayMemberPath properties of the ComboBoxItemsProvider object, please post the properties of your ReferenceData class and PrimaryData class that you are using.
Hello, I Try to reproduce the problem with the black selection, but I couldn’t. And also I don’t see any reason to get this problem if you populate the items source correctly. I think that the scenario is not much clear and I need more information.Did you set the DisplayMemberPath or Value path, if not try to set them after you set the Item source? reportGradeProvider1.ItemsSource = data; reportGradeProvider1.DisplayMemberPath = "Name"; reportGradeProvider1.ValuePath = "Name";Are you getting the expected objects as selected item after you press the tab?Did you handle some other events that may override the editor value?If this, doesn’t help, please try to make simple example where the problem is reproduced and I will look at it. I hope this helps.Best regards, DimiDeveloper Support EngineerInfragistics Inc.