Rabu, 22 Desember 2010

Obtaining and Setting Cell Values

Example 1

Dim CellValue As String
CellValue = GridView1.GetRowCellValue(2, "ID")



Example 2

The following sample code can be used to obtain the text displayed within the focused cell.


Dim nellValue As String = GridView.GetFocusedDisplayText()


Example 3

The following sample code can be used to get the value of the first column within the focused row.

Dim row As System.Data.DataRow = GridView1.GetDataRow(GridView1.FocusedRowHandle)
Dim CellValue As String = row(0)

Example 4

The following sample code can be used to change the focused cell's value.



With GridView1
   .SetRowCellValue(.FocusedRowHandle, .FocusedColumn, "New Value")
End With




Example 5

The following sample code can be used to set the value of the first column within the focused row.


System.Data.DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);
row[0] = "New Value";

Dim row As System.Data.DataRow = GridView1.GetDataRow(GridView1.FocusedRowHandle)
row(0) = "New Value"

Tidak ada komentar:

Posting Komentar