protected override void OnLoad(EventArgs e) { base.OnLoad(e); worksheet.ColumnHeaders[2].Width = 100; worksheet.ColumnHeaders[4].Width = 120; worksheet.SetRangeDataFormat(4, 3, 1, 1, DataFormat.CellDataFormatFlag.Percent, DataFormat.NumberDataFormatter.NoDecimalDigitsArgument); worksheet.SetRangeDataFormat(7, 3, 1, 1, DataFormat.CellDataFormatFlag.Percent, DataFormat.NumberDataFormatter.NoDecimalDigitsArgument); worksheet[4, 4] = new SlideCell(); worksheet[4, 4] = .5d; worksheet[4, 3] = "=E5"; worksheet[7, 4] = new SlideCell(); worksheet[7, 4] = .5d; worksheet[7, 2] = new NumericProgressCell(); worksheet[7, 2] = "=E8"; worksheet[7, 3] = "=E8"; worksheet[6, 2] = "bind by '=E8'"; worksheet[2, 3] = "Try slide the green thumb below..."; // link worksheet.MergeRange(12, 0, 1, 7); worksheet[11, 0] = "More info about Custom Cell:"; worksheet[12, 0] = new unvell.ReoGrid.CellTypes.HyperlinkCell( "https://reogrid.net/document/Custom%20Cell", true); }
public NumericProgressDemo() { InitializeComponent(); this.worksheet = grid.CurrentWorksheet; var rand = new Random(); worksheet[1, 2] = "Try change the value below: "; for (int r = 3; r < 8; r++) { // set customize cell body worksheet[r, 2] = new NumericProgressCell(); // set formula into cell which is used to get data from another cell worksheet[r, 2] = "=" + new CellPosition(r, 3).ToAddress(); // e.g. D3 // generate a random value worksheet[r, 3] = Math.Round(rand.NextDouble(), 2); } // set data format as percent worksheet.SetRangeDataFormat(3, 3, 5, 2, DataFormat.CellDataFormatFlag.Percent, new DataFormat.NumberDataFormatter.NumberFormatArgs { DecimalPlaces = 0, }); // change selection forward direction to down worksheet.SelectionForwardDirection = SelectionForwardDirection.Down; // put focus on cell worksheet.FocusPos = new CellPosition(3, 3); // link worksheet.MergeRange(12, 0, 1, 7); worksheet[11, 0] = "More info about Custom Cell:"; worksheet[12, 0] = new HyperlinkCell( "https://reogrid.net/document/Custom%20Cell", true); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); grid.SetColsWidth(2, 1, 100); grid.SetColsWidth(4, 1, 120); grid[4, 4] = new SlideCell(); grid[4, 4] = 50; grid[4, 3] = "=E5+'%'"; grid[7, 4] = new SlideCell(); grid[7, 4] = 50; grid[7, 2] = new NumericProgressCell(); grid[7, 2] = "=E8"; grid[7, 3] = "=E8+'%'"; grid[6, 2] = "bind by '=E8'"; grid[2, 3] = "Try slide the green thumb below..."; // link grid.MergeRange(12, 0, 1, 7); grid[11, 0] = "More info about Custom Cell:"; grid[12, 0] = new unvell.ReoGrid.CellTypes.HyperlinkCell( "https://reogrid.codeplex.com/wikipage?title=Custom%20Cell&referringTitle=Documentation", true); }