Hi Al,,
I am new in Infragistics.
I am using XamGrid .
I want to add the new row in the grid. I am able to add it inline but how to get the updated collection in ViewModel or data which is addded by the user in the XamGrid how to get that in the View Model.
Below is my code for Xam Grid:-
<ig:XamGrid x:Name="xamDataGrid1" AutoGenerateColumns="False" ItemsSource="{Binding Path=Products}" DeleteKeyAction="DeleteRowOfActiveCell">
<ig:XamGrid.AddNewRowSettings>
<ig:AddNewRowSettings AllowAddNewRow="Bottom" />
</ig:XamGrid.AddNewRowSettings>
<ig:XamGrid.SelectionSettings>
<ig:SelectionSettings CellClickAction="SelectRow" RowSelection="Single"/>
</ig:XamGrid.SelectionSettings><ig:XamGrid.EditingSettings>
<ig:EditingSettings AllowEditing="Cell" IsMouseActionEditingEnabled="DoubleClick"/></ig:XamGrid.EditingSettings>
<ig:XamGrid.Columns>
<ig:TextColumn AddNewRowItemTemplate="{StaticResource rowItemTemplate}" Key="ProductID" ></ig:TextColumn>
<ig:TextColumn AddNewRowItemTemplate="{StaticResource rowItemTemplate}" Key="ProductName" ></ig:TextColumn>
<ig:TextColumn AddNewRowItemTemplate="{StaticResource rowItemTemplate}" Key="UnitPrice" ></ig:TextColumn>
<ig:TextColumn AddNewRowItemTemplate="{StaticResource rowItemTemplate}" Key="UnitsInStock" ></ig:TextColumn>
</ig:XamGrid.Columns></ig:XamGrid>
Itemsource of the grid is Products in my VM. So which property I will bind or command so that I will get the new added row in the ViewModel. I need to follow MVVM.
Please help me its very urgent.
Hello,
We are still following this forum thread.Have you been able to look at the provided sample application?
If you have any other questions or concerns about this matter please do not hesitate to contact us.
Here is the WPF sample.
Thank u for the sample. But your sample is in Silverlight . I am creating Windows application in WPF. Please share it that. I am not able to open silverlight application.
Thank you for your post. I have been looking into it and and I created a sample project for following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.