Hi,guys,my data grid's datasource is hierarchical data, and I needs to define the FieldLayout in Xaml file,how can I define both the parent records and child record's fieldlayout?
As I said in my previous comment, I was able to get this hierarchical data to display correctly but I'm having a problem selecting rows within my XamDataGrid when there is a hierarchy of records displayed. I set the 'SelectionTypeRecord' property in my FieldLayoutSettings to "Extended" and I'm able to multi-select child records in any of my top-level records. But once I select multiple records under one parent node, I can’t select any other child records in the other nodes. What am I missing here? Anyone have any ideas?
I have also tried to set the SelectionTypeRecord property of the child Layout in the FieldLayoutInitialized method of XamDataGrid like below but of no use.XamDataGrid1.FieldLayouts[1].Settings.SelectionTypeRecord = Infragistics.Windows.Controls.SelectionType.Extended;XamDataGrid1.FieldLayouts[1].Settings.SelectionTypeField = Infragistics.Windows.Controls.SelectionType.Extended;XamDataGrid1.Records.FieldLayout.Settings.SelectionTypeRecord = Infragistics.Windows.Controls.SelectionType.Extended;
Hi Jackie,
I'm having the same problem. I couldn't find a way to fix this in my xaml code, but was able to work around this in source code. I created an event handler for the InitializeRecord event as shown below:
{ .... this.myDataGrid.InitializeRecord +=new EventHandler<Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs> (myDataGrid_InitializeRecord);}
void myDataGrid_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e){ if(! e.Record.HasChildren) e.Record.ExpansionIndicatorVisibility = Visibility.Collapsed;
}If you end up finding a better way (especially in xaml), please share with the rest of us...Ramiro
Hi,
I have another problem. The plus/minus will show up no matter whether there are sub items or not. How to hide them when there is no sub items?
Thanks,
Jackie
I was able to get this hierarchical data to display correctly with Joe's tips, but I'm having a problem selecting rows within my XamDataGrid when there is a hierarchy of records displayed. I set the 'SelectionTypeRecord' property in my FieldLayoutSettings to "Extended" and I'm able to multi-select child records in any of my top-level records. But once I select multiple records under one parent node, I cannont select any other child records in the other nodes. What am I missing here? Anyone have any ideas?
thanks...
Great, thanks a lot.