本文整理匯總了VB.NET中System.Windows.Forms.DataGridTableStyle.AllowSortingChanged事件的典型用法代碼示例。如果您正苦於以下問題:VB.NET DataGridTableStyle.AllowSortingChanged事件的具體用法?VB.NET DataGridTableStyle.AllowSortingChanged怎麽用?VB.NET DataGridTableStyle.AllowSortingChanged使用的例子?那麽, 這裏精選的事件代碼示例或許可以為您提供幫助。您也可以進一步了解該事件所在類System.Windows.Forms.DataGridTableStyle
的用法示例。
在下文中一共展示了DataGridTableStyle.AllowSortingChanged事件的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: DataGridTableStyle
Private Sub DataGridTableStyle_Sample_Load(ByVal sender As Object, _
ByVal e As EventArgs) Handles MyBase.Load
myDataGridTableStyle1 = New DataGridTableStyle()
mylabel.Text = "Sorting Status :" + myDataGridTableStyle1.AllowSorting.ToString()
If myDataGridTableStyle1.AllowSorting = True Then
btnApplyStyles.Text = "Remove Sorting"
Else
btnApplyStyles.Text = "Apply Sorting"
End If
' Attach custom event handlers.
AddHandler myDataGridTableStyle1.AllowSortingChanged, AddressOf AllowSortingChanged_Handler
myDataGridTableStyle1.MappingName = "Customers"
End Sub
Private Sub AllowSortingChanged_Handler(ByVal sender As Object, ByVal e As EventArgs)
mylabel.Text = "Sorting Status :" + myDataGridTableStyle1.AllowSorting.ToString()
End Sub
Private Sub btnApplyStyles_Click(ByVal sender As Object, _
ByVal e As EventArgs) Handles btnApplyStyles.Click
If myDataGridTableStyle1.AllowSorting = True Then
' Remove sorting.
myDataGridTableStyle1.AllowSorting = False
btnApplyStyles.Text = "Allow Sorting"
Else
' Allow sorting.
myDataGridTableStyle1.AllowSorting = True
btnApplyStyles.Text = "Remove Sorting"
End If
mylabel.Text = "Sorting Status :" + myDataGridTableStyle1.AllowSorting.ToString
' Add the DataGridTableStyle to DataGrid.
myDataGrid.TableStyles.Add(myDataGridTableStyle1)
End Sub