private void button2_Click(object sender, EventArgs e) { // ExStart:AddingRowStyle // Accessing the worksheet of the Grid that is currently active Worksheet sheet = gridDesktop1.GetActiveWorksheet(); // Accessing the first row of the worksheet Aspose.Cells.GridDesktop.Data.GridRow row = sheet.Rows[0]; // Getting the Style object for the row //Style style = row.GetStyle(); // Setting Style properties i.e. border, color, alignment, background color etc. //style.SetBorderLine(BorderType.Right, BorderLineType.Thick); //style.SetBorderColor(BorderType.Right, Color.Blue); //style.HAlignment = HorizontalAlignmentType.Centred; //style.Color = Color.Yellow; // Setting the style of the row with the customized Style object //row.SetStyle(style); // ExEnd:AddingRowStyle }
private void button2_Click(object sender, EventArgs e) { // ExStart:SetRowHeight // Accessing the worksheet of the Grid that is currently active Worksheet sheet = gridDesktop1.GetActiveWorksheet(); // Adding sample value to sheet cells GridCell cell = sheet.Cells["b2"]; cell.SetCellValue("1"); cell = sheet.Cells["c2"]; cell.SetCellValue("2"); cell = sheet.Cells["d2"]; cell.SetCellValue("3"); cell = sheet.Cells["e2"]; cell.SetCellValue("4"); // Accessing the first row of the worksheet Aspose.Cells.GridDesktop.Data.GridRow row = sheet.Rows[1]; // Setting the height of the row row.Height = 100; // ExEnd:SetRowHeight }