行または列にスタイルを適用する

列にスタイルを適用する

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