本文整理汇总了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