I have a scenerio where when the user edits a record, the small icon of ‘modified record’ appears in the Record Selector area. After I save the changes (or even if I cancel the changes) and update the data source connected to the grid, that icon never goes away. Moreover, if the changes are successfully saved, the record remains highlighted, even though the active record has changed. After editing a few records, the grid looks like the picture attached. How do I fix it? I tried calling ExecuteCommand(DataPresenterCommands.CommitChangesToAllRecords) but that didn't work for me unless I was using it incorrectly.
HI,
The rowselector icon, is show because you have selected multiple records and or cells. It also appears if you have an ActiveRecord, which is a record ready to receive keyboard input.
You can remove the icon by doing the following
xgrid1.SelectedItems.Records.Clear();
xgrid1.SelectedItems.Cells.Clear();
xgrid1.ActiveRecord = null;
Sincerely, Matt
Developer Support Engineer
Just to clarify its the modified icon below I want to get rid of thats in the selector area. Is there a command that will do so or I have to do what you stated above? The selection icon works fine.
This helped thank you. I noticed I was using OnCellChangeOrLostFocus instead of OnUpdate. Is there a difference between the two? I used OnCellChangeOrLostFocus because I have CellClickAction="EnterEditModeIfAllowed".
Here is a link on the various updatemodes:
http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.2~Infragistics.Windows.DataPresenter.UpdateMode.html
Sincerely,
MattDeveloper Support Engineer
Thank you. I have another question. In a hierachical data binding, how can I disable the filter showing up for the child records?
HI ,
You can wire up the FiedlLayoutintilizing event and set it there int count = 0;
private void xgrid1_FieldLayoutInitializing(object sender, Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializingEventArgs e)
{
if (count == 0)
e.FieldLayout.FieldSettings.AllowRecordFiltering = true;
count++
}
else e.FieldLayout.FieldSettings.AllowRecordFiltering = false;
If you define your field layouts in Xaml and you can specify in the fieldsetting for each layout:. <igDP:FieldLayout >
<igDP:FieldLayout.FieldSettings>
<igDP:FieldSettings AllowRecordFiltering="True"/>
</igDP:FieldLayout.FieldSettings>
<igDP:FieldLayout.Fields>
<igDP:Field Name="Name"/>
<igDP:Field Name="Age"/>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
Please let me know if you need further assistance regarding this issue.
Matt