private static BvgCell GetCell(BvgRow row, BvgColumn col, T item, BvgGrid _bvgGrid, bool SetValue) { BvgCell cell = new BvgCell { bvgRow = row, bvgColumn = col, HasCol = true, bvgGrid = _bvgGrid, }; if (SetValue) { cell.Value = col.prop.GetValue(item, null).ToString(); } if (col.IsFrozen) { cell.CssClass = CellStyle.CellFrozen.ToString(); } else { cell.CssClass = CellStyle.CellNonFrozen.ToString(); } cell.UpdateID(); return(cell); }
public static void GetRows(T[] list, BvgGrid _bvgGrid) { ushort k = 0; if (!_bvgGrid.Rows.Any()) { _bvgGrid.Rows = new BvgRow[list.Count()]; ushort j = 0; ushort g = 0; foreach (T item in list) { BvgRow row = new BvgRow { ID = k++, bvgGrid = _bvgGrid, Cells = new BvgCell[_bvgGrid.Columns.Count()], }; row.IsEven = row.ID % 2 == 0; g = 0; foreach (BvgColumn col in _bvgGrid.Columns) { row.Cells[g] = GetCell(row, col, item, _bvgGrid, true); g++; } _bvgGrid.Rows[j] = row; j++; } } else { RefreshRows(list, _bvgGrid, false); } }
private static BvgCell <T> GetCell(BvgRow <T> row, BvgColumn <T> col, T item, BvgGrid <T> _bvgGrid) { BvgCell <T> cell = new BvgCell <T> { bvgRow = row, bvgColumn = col, bvgGrid = _bvgGrid, Value = col.prop.GetValue(item, null).ToString(), ID = string.Concat("C", col.ID, "R", row.ID), }; if (col.IsFrozen) { cell.CssClassBase = CellStyle.CF.ToString(); } else { cell.CssClassBase = CellStyle.CNF.ToString(); } return(cell); }
public static void GetRows(T[] list, BvgGrid <T> _bvgGrid, ushort skip) { ushort k = 0; if (!_bvgGrid.Rows.Any()) { _bvgGrid.Rows = new BvgRow <T> [list.Count()]; ushort j = 0; ushort g = 0; foreach (T item in list) { BvgRow <T> row = new BvgRow <T> { ID = k++, IndexInSource = (ushort)(k + skip), bvgGrid = _bvgGrid, Cells = new BvgCell <T> [_bvgGrid.Columns.Count()], }; g = 0; foreach (BvgColumn <T> col in _bvgGrid.Columns) { row.Cells[g] = GetCell(row, col, item, _bvgGrid); g++; } _bvgGrid.Rows[j] = row; j++; } } else { RefreshRows(list, _bvgGrid, false, skip); } }