本文整理汇总了VB.NET中System.Windows.Controls.DataGrid.RowHeaderStyle属性的典型用法代码示例。如果您正苦于以下问题:VB.NET DataGrid.RowHeaderStyle属性的具体用法?VB.NET DataGrid.RowHeaderStyle怎么用?VB.NET DataGrid.RowHeaderStyle使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Windows.Controls.DataGrid
的用法示例。
在下文中一共展示了DataGrid.RowHeaderStyle属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Convert
Public Class ConvertItemToIndex
Implements IValueConverter
Public Function Convert(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
Try
'Get the CollectionView from the DataGrid that is using the converter
Dim dg As DataGrid = DirectCast(Application.Current.MainWindow.FindName("DG1"), DataGrid)
Dim cv As CollectionView = DirectCast(dg.Items, CollectionView)
'Get the index of the item from the CollectionView
Dim rowindex As Integer = cv.IndexOf(value) + 1
Return rowindex.ToString()
Catch e As Exception
Throw New NotImplementedException(e.Message)
End Try
End Function
Public Function ConvertBack(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class