CellStyle.Formatプロパティに書式文字列を指定すると、テキストの内容を表示する際に書式を適用できます。
次のコードは整数型の値を現在のカルチャの通貨書式で表示します。
Imports GrapeCity.Win.MultiRow
Dim TextBoxCell1 As TextBoxCell = TryCast(gcMultiRow1.Rows(0).Cells(0), TextBoxCell)
TextBoxCell1.ReadOnly = True
TextBoxCell1.Value = 20000
TextBoxCell1.Style.Format = "c"
using GrapeCity.Win.MultiRow;
TextBoxCell textBoxCell1 = gcMultiRow1.Rows[0].Cells[0] as TextBoxCell;
textBoxCell1.ReadOnly = true;
textBoxCell1.Value = 20000;
textBoxCell1.Style.Format = "c";
CellStyle.FormatProviderプロパティを使用すると、書式に適用するカルチャを指定できます。次のコードは米国の通貨形式で値を表示します。
Imports GrapeCity.Win.MultiRow
Imports System.Globalization
Dim TextBoxCell1 As TextBoxCell = TryCast(gcMultiRow1.Rows(0).Cells(0), TextBoxCell)
TextBoxCell1.ReadOnly = True
TextBoxCell1.Value = 20000
TextBoxCell1.Style.Format = "c"
TextBoxCell1.Style.FormatProvider = New CultureInfo("en-US")
using GrapeCity.Win.MultiRow;
using System.Globalization;
TextBoxCell textBoxCell1 = gcMultiRow1.Rows[0].Cells[0] as TextBoxCell;
textBoxCell1.ReadOnly = true;
textBoxCell1.Value = 20000;
textBoxCell1.Style.Format = "c";
textBoxCell1.Style.FormatProvider = new CultureInfo("en-US");