'宣言 Public Overloads Function GetLabelValueHolder( _ ByVal column As Integer _ ) As CellValueHolder
public CellValueHolder GetLabelValueHolder( int column )
セルがクリップボードにコピーされると、フィールド ラベルは、CopyFieldLabelsToClipboard の値に基づいて任意に出力に含まれます。このメソッドを使用すると、指定したフィールドのためにクリップボードに出力するテキストを提供できます。これは、Infragistics.Windows.DataPresenter.FieldItem.Label が文字列以外の値に設定されている場合に便利です。
Imports Infragistics.Windows.DataPresenter Private Sub grid_ClipboardCopying(ByVal sender As System.Object, ByVal e As Infragistics.Windows.DataPresenter.Events.ClipboardCopyingEventArgs) For i As Integer = 0 To e.FieldCount - 1 Dim field As Field = e.GetSourceField(i) Dim labelValue As CellValueHolder = e.GetLabelValueHolder(i) ' the display uses shortened names for the labels in the ' display but we want to put more verbose descriptions in ' the clipboard If field.Name = "salary" Then labelValue.Value = "Salary" labelValue.IsDisplayText = True ElseIf field.Name = "department" Then labelValue.Value = "Department" labelValue.IsDisplayText = True End If Next End Sub
using Infragistics.Windows.DataPresenter; private void grid_ClipboardCopying(object sender, Infragistics.Windows.DataPresenter.Events.ClipboardCopyingEventArgs e) { for (int i = 0; i < e.FieldCount; i++) { Field field = e.GetSourceField(i); CellValueHolder labelValue = e.GetLabelValueHolder(i); // the display uses shortened names for the labels in the // display but we want to put more verbose descriptions in // the clipboard if (field.Name == "salary") { labelValue.Value = "Salary"; labelValue.IsDisplayText = true; } else if (field.Name == "department") { labelValue.Value = "Department"; labelValue.IsDisplayText = true; } } }