GridColumnStylesCollection.Clear Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Nesne koleksiyonunu DataGridColumnStyle temizler.
public:
void Clear();
public void Clear ();
member this.Clear : unit -> unit
Public Sub Clear ()
Örnekler
Aşağıdaki kod örneğinde bu üyenin kullanımı gösterilmektedir.
private:
void Clear_Clicked( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
// TablesAlreadyAdded set to false so that table styles can be added again.
TablesAlreadyAdded = false;
myLabel->Text = "All Table Styles Cleared.";
// Clear all the column styles and also table style for the grid.
IEnumerator^ myEnum = myDataGrid->TableStyles->GetEnumerator();
while ( myEnum->MoveNext() )
{
DataGridTableStyle^ myTableStyle = safe_cast<DataGridTableStyle^>(myEnum->Current);
GridColumnStylesCollection^ myColumns = myTableStyle->GridColumnStyles;
myColumns->Clear();
}
myDataGrid->TableStyles->Clear();
}
private void Clear_Clicked(object sender, System.EventArgs e)
{
// TablesAlreadyAdded set to false so that table styles can be added again.
TablesAlreadyAdded = false;
myLabel.Text = "All Table Styles Cleared.";
// Clear all the column styles and also table style for the grid.
foreach (DataGridTableStyle myTableStyle in myDataGrid.TableStyles)
{
GridColumnStylesCollection myColumns = myTableStyle.GridColumnStyles;
myColumns.Clear();
}
myDataGrid.TableStyles.Clear();
}
Private Sub Clear_Clicked(ByVal sender As Object, ByVal e As System.EventArgs) Handles clearButton.Click
' TablesAlreadyAdded set to false so that table styles can be added again.
TablesAlreadyAdded = False
myLabel.Text = "All Table Styles Cleared."
' Clear all the column styles and also table style for the grid.
Dim myTableStyle As DataGridTableStyle
For Each myTableStyle In myDataGrid.TableStyles
Dim myColumns As GridColumnStylesCollection = myTableStyle.GridColumnStyles
myColumns.Clear()
Next myTableStyle
myDataGrid.TableStyles.Clear()
End Sub