Hi,
we have xamgrid with unboun column (edit) on each row. and we have save button outside the xamgrid. user is allowed to edit any no of rows. once he finished editing rows, i would like to get only the modified rows after we click on save button outside in to view model. below is the code.
<
ig:XamGrid x:Name="XamMetaGrid"
HorizontalAlignment="Left"
Margin="5,52,0,42" PreviewMouseLeftButtonDown="XamMetaGrid_PreviewMouseLeftButtonDown_1"
ItemsSource="{Binding FillGrid, Mode=TwoWay}" IsEnabled="True" Width="601"
ActiveItem="{Binding ColumnVisibilityCustom.GridSelectedRowData, Mode=TwoWay, Source={StaticResource proxy}, UpdateSourceTrigger=PropertyChanged}">
<ig:XamGrid.Columns>
<ig:UnboundColumn IsFixable="True" Key="EditColumn" HeaderText=" " Visibility ="{Binding ColumnVisibilityCustom.ColumnVisibility, Source={StaticResource proxy}}">
<ig:UnboundColumn.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" >
<Button Content="Edit" Width="40" Click="EditButton_Click" >
<ig:Commanding.Command>
<ig:XamGridRowCommandSource EventName="Click" AllowEventHandling="True" CommandType="Edit" >
</ig:XamGridRowCommandSource>
</ig:Commanding.Command>
</Button>
</StackPanel>
</DataTemplate>
</ig:UnboundColumn.ItemTemplate>
</ig:UnboundColumn>
</ig:XamGrid.Columns>
<ig:XamGrid.SelectionSettings>
<ig:SelectionSettings ColumnSelection="Single" RowSelection="Single" CellClickAction="SelectRow">
</ig:SelectionSettings>
</ig:XamGrid.SelectionSettings>
<ig:XamGrid.EditingSettings>
<ig:EditingSettings />
</ig:XamGrid.EditingSettings>
<ig:XamGrid.PagerSettings>
<ig:PagerSettings AllowPaging="Bottom"
PageSize="100" />
</ig:XamGrid.PagerSettings>
<ig:XamGrid.ColumnTypeMappings>
<ig:ColumnTypeMapping ColumnType="ig:TextColumn" DataType="system:DateTime" />
</ig:XamGrid.ColumnTypeMappings>
</ig:XamGrid>
<Label Content="Table"
Height="24"
Margin="5,10,0,0"
VerticalAlignment="Top"
Width="41" RenderTransformOrigin="-0.195,0.25"/>
<Button Content="Import"
Margin="543,10,0,0"
Width="63"
Click ="ImportButton_Click"
Command="{Binding ImportButtonClick}"
IsEnabled="{Binding IsImportEnabled}" />
<Button Content="Cancel"
Margin="543,392,0,0"
VerticalAlignment="Bottom"
RenderTransformOrigin="0.524,0.5"
Click="CancelButton_Click"/>
<Button Content="Save"
Margin="5,413,0,0"
Width="75"
Command="{Binding EditSaveButtonClick}"/>
=======================
FillGrid is a dataview
protected
DataView _fillGrid;
public DataView FillGrid
{
get { return _fillGrid; }
set
if (_fillGrid != value)
_fillGrid =
value;
NotifyPropertyChanged(
"FillGrid");
}
once we click on savee button, i would like to get only the modified rows in to FillGrid. please help me out. its quite urgent.
Hello Subramani,
Thank you for your post!
I have been looking into it.
What I can suggest is to take a look at the following link, where a similar issue is discussed: http://www.infragistics.com/community/forums/t/85293.aspx.
You can add a Boolean property to the model, that you can set to true, when the editing of the cell is finished and on the click of the save button you can get the records, for which this property is set to true.
Please do not hesitate to let me know if you have any further questions on this matter.
I am just checking if you have any further questions on this matter. Please do not hesitate to let me know if you do.