Hi, I am trying to use XamDataGrid for Order entry scenario. An Order have a collection on Details, and each Detail have a reference to a Product. The XamDataGrid contains the list of Details and Im trying to provide funtionality to Edit and Add new Details.To show complex data Im using UnboundField and the first problem I get is that the new row template is not showing up even though I enabled adding new row. I have attached a sample to demostrate my issue.
This is my xaml definition:
<igDP:XamDataGrid DataSource="{Binding Path=Master.Details}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings CellClickAction="EnterEditModeIfAllowed" /> </igDP:XamDataGrid.FieldSettings>
<igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False" AllowAddNew="True" AddNewRecordLocation="OnTop" AllowClipboardOperations="All" AllowDelete="True" /> </igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields>
<igDP:UnboundField Name="ProductCode" Label="Code" BindingPath="Product.ProductCode" BindingMode="TwoWay" />
<igDP:UnboundField Name="ProductName" Label="Name" BindingPath="Product.ProductName" BindingMode="TwoWay" />
</igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
Thanks
Elio
Hello Elio,
I am just checking if you have any further questions on this matter.
Please do not hesitate to let me know if you do.
Sincerely,
Radko Kolev
Infragistics Inc.
www.infragistics.com/support
Thanks you for your post. I was looking at your issue and I was able to create a mockup of your datasource files based on your description and the code snippet you provided and it seems to be working - the add new record row is present (see attached sample).
Also keen in mind that the add new record row will not be present if your data source does not support adding. This may happen for a number of reasons. For example your collection may be a read-only collection or the collection itself may not have been created at all. You may try to comment the creation of the List in my example (as shown in the comment in the code behind of the main page) and the add new record row will disappear.
Please do not hesitate to let me know if you have any further questions on this matter.