public void LinkGrid() { if (!makeGridCompleted) { throw new Exception("MakeGrid not completed"); } LinkedCells.Clear(); LinkedRows.Clear(); if (MyDataBC == null) { throw new Exception("Bad MyData"); } for (int i = 0; i < gridRowList.Count; i++) { var rowdef = gridRowList[i]; try { rowdef.LinkRow(); rowdef.UpdateDataCell(); } catch (Exception ex) { throw new Exception("LinkRow failed: " + rowdef.Name, ex); } } }
public void MakeGrid() { LinkedCells.Clear(); LinkedRows.Clear(); this.ColumnsCount = 3; this.Columns[0].Width = ColumnWidth1; this.Columns[1].Width = ColumnWidth2; this.Columns[2].Width = ColumnWidth3; for (int i = 0; i < gridRowTemplateList.Count; i++) { var rowdef = gridRowTemplateList[i]; rowdef.MakeTemplateRow(this); } int rowscount = 0; for (int i = 0; i < gridRowList.Count; i++) { rowscount += gridRowList[i].GetRowCount(); } this.RowsCount = rowscount; int rownr = 0; for (int i = 0; i < gridRowList.Count; i++) { var rowdef = gridRowList[i]; rowdef.MakeRow(Rows[rownr]); rownr += rowdef.GetRowCount(); } ScaleControlA(scaleFactor); this.Controller.AddController(MarkCurrentRowController.Default); makeGridCompleted = true; }