My model is as below
public class FItem
{
public FItem()
FSubsystems = new List<FSubsystem>();
FReferences = new List<FReference>();
FWildcards = new List<FWildcard>();
}
public int RecordId { get; set; }
public int MarketId { get; set; }
public string ItemName { get; set; }
public string ItemFamily { get; set; }
public string HoverFamily { get; set; }
public string ItemDesc { get; set; }
public int? FixedSiteDetail { get; set; }
public int? ItemPathID { get; set; }
| | remainig properties here .....
public List<FSubsystem> FSubsystems { get; set; }
public List<FReference> FReferences { get; set; }
public List<FWildcard> FWildcards { get; set; }
I bind this model to a xamdatagrid via viewmodel . My xamCode is as below
<igDP:XamDataGrid Name="dgRecords" DataSource="{Binding FItems, Mode=TwoWay}" ScrollingMode="DeferredWithScrollTips" MaxHeight="500" MinHeight="300" Theme="IGTheme"
RecordContainerGenerationMode="Virtualize" ScrollBehaviorOnListChange="PreserveRecordsInView" FieldLayoutInitialized="dgRecords_FieldLayoutInitialized">
<igDP:XamDataGrid.ViewSettings>
<igDP:GridViewSettings />
</igDP:XamDataGrid.ViewSettings>
<igDP:XamDataGrid.FieldLayoutSettings >
<igDP:FieldLayoutSettings AutoGenerateFields="True" AllowAddNew="True"
AllowAddNew
=
True
AddNewRecordLocation="OnTopFixed"/>
AddNewRecordLocation
OnTopFixed
</igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout/>
</igDP:XamDataGrid.FieldLayouts>
<igDP:XamDataGrid.FieldSettings>
<igDP:FieldSettings AllowRecordFiltering="True" AllowSummaries="True" AllowEdit="True" AutoSizeScope="ViewableRecords" />
</igDP:XamDataGrid.FieldSettings>
</igDP:XamDataGrid>
I auto generate columns .
I am getting button to add new rows to Fitem grid . But I am not able to add new rows to inner grids (FSubsystems ,FReferences,FWildcards).
How can I add rows to inner grids ?
Hello Nithesh Kuntady,
To enable a record to be added to the child grid in FSubsystems, FReferences, and FWildcards is done by allowing one record to be presented in the sub collections. Initially the records can be set to expanded to allow the child grid to be shown by setting the IsExpanded property to true from the Record parameter and handling the InitializeRecord event.
Let me know if I can provide any further assistance.