本文整理汇总了VB.NET中System.Windows.Forms.DataGrid.Item属性的典型用法代码示例。如果您正苦于以下问题:VB.NET DataGrid.Item属性的具体用法?VB.NET DataGrid.Item怎么用?VB.NET DataGrid.Item使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Windows.Forms.DataGrid
的用法示例。
在下文中一共展示了DataGrid.Item属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: SetCellValue
Private Sub SetCellValue(ByVal myGrid As DataGrid)
Dim myCell As New DataGridCell()
' Use an arbitrary cell.
myCell.RowNumber = 1
myCell.ColumnNumber = 1
' Change the cell's value using the CurrentCell.
myGrid(myCell)= "New Value"
End Sub
Private Sub GetCellValue(ByVal myGrid As DataGrid)
Dim myCell As New DataGridCell()
' Use an arbitrary cell.
myCell.RowNumber = 1
myCell.ColumnNumber = 1
Console.WriteLine(myGrid(myCell))
End Sub
示例2: PrintCells
Private Sub PrintCells(ByVal myGrid As DataGrid)
Dim iRow As Integer
Dim iCol As Integer
Dim myTable As DataTable
' Assumes the DataGrid is bound to a DataTable.
myTable = CType(DataGrid1.DataSource, DataTable)
For iRow = 0 To myTable.Rows.Count - 1
For iCol = 0 To myTable.Columns.Count - 1
Console.WriteLine(myGrid(iRow, iCol))
Next iCol
Next iRow
End Sub