在行或列上应用样式

在列上应用样式

要使用 Aspose.Cells.GridDesktop 在列上应用自定义样式,请按照以下步骤操作:

  • 访问任何想要的工作表
  • 访问一个柱子我们要在其上应用风格
  • 得到风格柱子
  • 风格根据您的自定义需求属性
  • 最后,设置风格柱子与更新的

提供了许多有用的属性和方法风格开发人员可以使用该对象根据他们的要求自定义样式。

在行上应用样式

要使用 Aspose.Cells.GridDesktop 在一行上应用自定义样式,请按照以下步骤操作:

  • 访问任何想要的工作表
  • 访问一个我们要在其上应用风格
  • 得到风格
  • 风格根据您的自定义需求属性
  • 最后,设置风格与更新的

提供了许多有用的属性和方法风格开发人员可以使用该对象根据他们的要求自定义样式。

 // 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);