BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
this.gridDataBoundGrid1.Binder.RecordsRemoved
>this.gridDataBoundGrid1.Binder.RecordsRemoved
>
CurrencyManager cm = grid.BindingContext[grid.DataSource, grid.DataMember] as CurrencyManager;
DataView dv = cm.List as DataView;
dv.ListChanged += new ListChangedEventHandler(dv_ListChanged);
Then in the handler, if a row is being deleted, and the current rowindex needs to be adjusted, adjust it.
private void cm_PositionChanged(object sender, EventArgs e) { CurrencyManager cm = sender as CurrencyManager; int rowIndex = this.gridDataBoundGrid1.Binder.PositionToRowIndex(cm.Position); if(this.gridDataBoundGrid1.CurrentCell.RowIndex != rowIndex) { this.gridDataBoundGrid1.CurrentCell.MoveTo(rowIndex, this.gridDataBoundGrid1.CurrentCell.ColIndex); GridSelectionChangedEventArgs ea = new GridSelectionChangedEventArgs(GridRangeInfo.Row(rowIndex), null, GridSelectionReason.SelectRange); this.gridDataBoundGrid1.Model.RaiseSelectionChanged(ea); } }