public virtual void Invalidate(DataTable table) { this.Clear(); OriginalList.Clear(); BaseBusinessController objItemController = BusinessControllerFactory.GetBusinessController(ItemTableName + "Controller"); //Invalidate lookup edit columns to reflect all changes of lookup table //if (GridControl != null) // GridControl.InvalidateLookupEditColumns(); foreach (DataRow row in table.Rows) { T objT = (T)objItemController.GetObjectFromDataRow(row); this.Add(objT); OriginalList.Add((T)objT.Clone()); } if (GridControl != null) { GridControl.RefreshDataSource(); if (this.Count > 0) { if (CurrentIndex >= 0 && CurrentIndex < Count) { GridViewFocusRow(CurrentIndex); } else { GridViewFocusRow(0); } } } }
public virtual BusinessObject GetBusinessObject(int pRowHandle, BaseBusinessController objCtrl) { if (pRowHandle < 0) { return(null); } if (string.IsNullOrWhiteSpace(VinaDataSource)) { if (objCtrl != null) { return((BusinessObject)objCtrl.GetObjectFromDataRow((MainView as DevExpress.XtraGrid.Views.Grid.GridView).GetDataRow(pRowHandle))); } return(null); } return((BusinessObject)(MainView as DevExpress.XtraGrid.Views.Grid.GridView).GetRow(pRowHandle)); }