DataGridColumnStyle.NullTextChanged Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the NullText value changes.
public:
event EventHandler ^ NullTextChanged;
public event EventHandler NullTextChanged;
member this.NullTextChanged : EventHandler
Public Custom Event NullTextChanged As EventHandler
Event Type
Examples
The following code example demonstrates the use of this member.
private:
void AddCustomColumnStyle()
{
myTableStyle = gcnew DataGridTableStyle;
myColumnStyle = gcnew DataGridTextBoxColumn;
myColumnStyle->NullTextChanged += gcnew EventHandler( this, &MyForm::columnStyle_NullTextChanged );
myTableStyle->GridColumnStyles->Add( myColumnStyle );
myDataGrid->TableStyles->Add( myTableStyle );
}
// NullTextChanged event handler of DataGridColumnStyle.
void columnStyle_NullTextChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
{
for ( int i = 0; i < myRowcount; i++ )
{
myCell.RowNumber = i;
myDataGrid[ myCell ] = nullptr;
}
MessageBox::Show( "NullTextChanged Event is handled" );
}
private void AddCustomColumnStyle()
{
myTableStyle = new DataGridTableStyle();
myColumnStyle = new DataGridTextBoxColumn();
myColumnStyle.NullTextChanged += new EventHandler(columnStyle_NullTextChanged);
myTableStyle.GridColumnStyles.Add(myColumnStyle);
myDataGrid.TableStyles.Add(myTableStyle);
}
// NullTextChanged event handler of DataGridColumnStyle.
private void columnStyle_NullTextChanged(object sender, EventArgs e)
{
for(int i=0;i<myRowcount;i++)
{
myCell.RowNumber = i;
myDataGrid[myCell] = null;
}
MessageBox.Show("NullTextChanged Event is handled");
}
Private Sub AddCustomColumnStyle()
myTableStyle = New DataGridTableStyle()
myColumnStyle = New DataGridTextBoxColumn()
AddHandler myColumnStyle.NullTextChanged, AddressOf columnStyle_NullTextChanged
myTableStyle.GridColumnStyles.Add(myColumnStyle)
myDataGrid.TableStyles.Add(myTableStyle)
End Sub
' NullTextChanged event handler of DataGridColumnStyle.
Private Sub columnStyle_NullTextChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim i As Integer
For i = 0 To myRowcount - 1
myCell.RowNumber = i
myDataGrid(myCell) = Nothing
Next i
MessageBox.Show("NullTextChanged Event is handled")
End Sub
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET