DataGridViewCheckBoxCell.GetFormattedValue メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridViewCheckBoxCell.GetFormattedValue メソッドの意味・解説 

DataGridViewCheckBoxCell.GetFormattedValue メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

セルデータ書式指定済みの値を取得します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Protected Overrides Function
 GetFormattedValue ( _
    value As Object, _
    rowIndex As Integer, _
    ByRef cellStyle As DataGridViewCellStyle,
 _
    valueTypeConverter As TypeConverter, _
    formattedValueTypeConverter As TypeConverter, _
    context As DataGridViewDataErrorContexts _
) As Object
Dim value As Object
Dim rowIndex As Integer
Dim cellStyle As DataGridViewCellStyle
Dim valueTypeConverter As TypeConverter
Dim formattedValueTypeConverter As TypeConverter
Dim context As DataGridViewDataErrorContexts
Dim returnValue As Object

returnValue = Me.GetFormattedValue(value, rowIndex, cellStyle,
 valueTypeConverter, formattedValueTypeConverter, context)
protected override Object GetFormattedValue (
    Object value,
    int rowIndex,
    ref DataGridViewCellStyle cellStyle,
    TypeConverter valueTypeConverter,
    TypeConverter formattedValueTypeConverter,
    DataGridViewDataErrorContexts context
)
protected:
virtual Object^ GetFormattedValue (
    Object^ value, 
    int rowIndex, 
    DataGridViewCellStyle^% cellStyle, 
    TypeConverter^ valueTypeConverter, 
    TypeConverter^ formattedValueTypeConverter, 
    DataGridViewDataErrorContexts context
) override
protected Object GetFormattedValue (
    Object value, 
    int rowIndex, 
    /** @ref */ DataGridViewCellStyle cellStyle, 
    TypeConverter valueTypeConverter, 
    TypeConverter formattedValueTypeConverter, 
    DataGridViewDataErrorContexts context
)
JScript では、値型引数参照渡しされません。

パラメータ

value

書式設定される値。

rowIndex

セルの親行のインデックス

cellStyle

セル反映される DataGridViewCellStyle。

valueTypeConverter

書式指定済みの値の型へカスタム変換実行する、元の値の型に関連付けられた TypeConverter。カスタム変換不要な場合null 参照 (Visual Basic では Nothing)。

formattedValueTypeConverter

書式指定済みの値の型からカスタム変換実行する、その値の型に関連付けられた TypeConverterカスタム変換不要な場合null 参照 (Visual Basic では Nothing)。

context

書式指定済みの値が必要とされているコンテキストを示す DataGridViewDataErrorContexts 値のビットごとの組み合わせ

戻り値
書式設定適用された後のセルの値。セルが DataGridView コントロール一部ではない場合null 参照 (Visual Basic では Nothing)。

解説解説

DataGridView コントロールは、このメソッド呼び出して、FormattedValueType プロパティ示される型の等価表示用の値にセル値を変換しますコントロールは、セル値をこのメソッドvalue パラメータ渡します

このメソッドは、まず、valueBoolean 値 (TrueValue、FalseValue、IndeterminateValue のいずれかプロパティ設定されている場合は、CheckState 値) に変換します

変換失敗すると、DataGridView.DataError イベント発生します。このイベントハンドラない場合や、ハンドラで DataGridViewDataErrorEventArgs.ThrowException プロパティtrue設定している場合例外スローさます。

変換成功した場合、または、DataError イベントハンドラ存在していて、なおかつDataGridViewDataErrorEventArgs.ThrowException プロパティtrue設定されていない場合は、DataGridView.CellFormatting イベント発生します

CellFormatting イベント ハンドラで、valuecellStyle両方変更できます。ただし、ハンドラが DataGridViewCellFormattingEventArgs.FormattingApplied プロパティtrue設定してない場合、このメソッドは、cellStyle オブジェクト書式指定プロパティ使用してvalue書式設定します。これにより、別途 DataError イベント発生する場合あります

書式設定成功しcontext パラメータに ClipboardContent 値が含まれていた場合、このメソッドは、クリップボードコピーするための書式設定済みの値を String 型にして返しますそれ以外場合は、DataGridView コントロール表示される書式設定済みの値が返されます。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewCheckBoxCell クラス
DataGridViewCheckBoxCell メンバ
System.Windows.Forms 名前空間
FormattedValueType
DataGridView クラス
DataGridView.DataError イベント
DataGridViewCellStyle クラス
DataGridViewCellStyle.Format プロパティ
TypeConverter
DataGridViewDataErrorContexts
Boolean
CheckState 列挙
TrueValue
FalseValue
IndeterminateValue
DataGridView.CellFormatting イベント



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

DataGridViewCheckBoxCell.GetFormattedValue メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGridViewCheckBoxCell.GetFormattedValue メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS