本文整理汇总了VB.NET中System.Windows.Forms.DataGridColumnStyle.PropertyDescriptorChanged事件的典型用法代码示例。如果您正苦于以下问题:VB.NET DataGridColumnStyle.PropertyDescriptorChanged事件的具体用法?VB.NET DataGridColumnStyle.PropertyDescriptorChanged怎么用?VB.NET DataGridColumnStyle.PropertyDescriptorChanged使用的例子?那么恭喜您, 这里精选的事件代码示例或许可以为您提供帮助。您也可以进一步了解该事件所在类System.Windows.Forms.DataGridColumnStyle
的用法示例。
在下文中一共展示了DataGridColumnStyle.PropertyDescriptorChanged事件的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: AddCustomDataTableStyle
Private Sub myButton_Click(ByVal sender As Object, ByVal e As EventArgs)
If TablesAlreadyAdded Then
Return
End If
AddCustomDataTableStyle()
End Sub
Private Sub AddCustomDataTableStyle()
Dim myTableStyle As New DataGridTableStyle()
' Map DataGridTableStyle to a DataTable.
myTableStyle.MappingName = "Orders"
' Get CurrencyManager object.
Dim myCurrencyManager As CurrencyManager = CType(BindingContext(myDataSet, "Orders"), CurrencyManager)
' Use the CurrencyManager to get the PropertyDescriptor for column.
Dim myPropertyDescriptor As PropertyDescriptor = myCurrencyManager.GetItemProperties()("Amount")
' Construct a 'DataGridColumnStyle' object changing its format to 'Currency'.
Dim myColumnStyle As DataGridTextBoxColumn = New DataGridTextBoxColumn(myPropertyDescriptor, "c", True)
' Add EventHandler function for PropertyDescriptorChanged Event.
AddHandler myColumnStyle.PropertyDescriptorChanged, AddressOf MyPropertyDescriptor_Changed
myTableStyle.GridColumnStyles.Add(myColumnStyle)
' Add the DataGridTableStyle instance to the GridTableStylesCollection.
myDataGrid.TableStyles.Add(myTableStyle)
TablesAlreadyAdded = True
End Sub
Private Sub MyPropertyDescriptor_Changed(ByVal sender As Object, ByVal e As EventArgs)
myLabel.Text = "Property Descriptor Property of DataGridColumnStyle has changed"
End Sub
开发者ID:VB.NET开发者,项目名称:System.Windows.Forms,代码行数:28,代码来源:DataGridColumnStyle.PropertyDescriptorChanged