![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello. How can I set a specific row of a dataTable ? (I.e the DataTable has 10 rows, and I want to focus on row no. 7). Thanks ![]() |
#3
| |||
| |||
|
|
On May 22, 6:26 pm, "Mr. X." <nospam (AT) nospam_please (DOT) com> wrote: Hello. How can I set a specific row of a dataTable ? (I.e the DataTable has 10 rows, and I want to focus on row no. 7). Thanks ![]() Assuming your DataTable is bounded to a DataGridView because of using term "focus" which you may have meant it as "selecting"? So, you can do: ' Drag and drop a datagridview and make sure it has one column at least. '----------------------------------- Dim dt As New DataTable ' Adding 9 rows upon existing one, which will be 10 in total. For x As Integer = 1 To 9 Dim drow As DataRow = dt.NewRow dt.Rows.Add(drow) Next DataGridView1.DataSource = dt DataGridView1.Rows(0).Selected = False DataGridView1.Rows(6).Selected = True '----------------------------------- HTH, Onur Güzel |
#4
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |