/// <summary> /// Handles invocation of LoadVirtualRow events /// </summary> internal void DoLoadVirtualRowEvent(GridPanel panel, GridRow row) { if (LoadVirtualRow != null) { GridVirtualRowEventArgs ev = new GridVirtualRowEventArgs(panel, row, row.Index); LoadVirtualRow(this, ev); } }
/// <summary> /// Handles invocation of StoreVirtualRow events /// </summary> internal void DoStoreVirtualRowEvent(GridPanel gridPanel, GridRow gridRow) { if (StoreVirtualRow != null) { GridVirtualRowEventArgs ev = new GridVirtualRowEventArgs(gridPanel, gridRow, gridRow.Index); StoreVirtualRow(this, ev); } }
void SuperGridLoadVirtualRow(object sender, GridVirtualRowEventArgs e) { if (CurrencyManager != null && _Pdc != null) { GridRow row = e.GridRow; GridRow vrow = _Panel.VirtualTempInsertRow; int index = e.Index; if (vrow != null) { if (index == vrow.RowIndex) { for (int i = 0; i < _Panel.Columns.Count; i++) row.Cells[i].ValueEx = vrow.Cells[i].Value; row.RowNeedsSorted = vrow.NeedsSorted; row.IsTempInsertRow = vrow.IsTempInsertRow; return; } if (index > vrow.RowIndex) index--; } if (index == _Panel.VirtualRowCount) { if (_Panel.ShowInsertRow == true) { vrow = _Panel.VirtualInsertRow; if (vrow != null) { for (int i = 0; i < _Panel.Columns.Count; i++) row.Cells[i].ValueEx = vrow.Cells[i].Value; row.RowNeedsSorted = vrow.NeedsSorted; row.IsTempInsertRow = vrow.IsTempInsertRow; return; } } } if ((uint)index < CurrencyManager.List.Count) { row.DataItem = CurrencyManager.List[index]; row.DataItemIndex = index; foreach (GridColumn col in _Panel.Columns) { PropertyDescriptor pd = FindPropertyDescriptor(col); if (pd != null) row.Cells[col.ColumnIndex].ValueEx = pd.GetValue(row.DataItem); } } } }