Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
XamGrid - Inline add, update delete the row and the updated collection in ViewModel
posted

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.

Parents Reply Children
No Data