Kris

Kris

  • NA
  • 2
  • 0

selecting a specific cell in a datagrid

Mar 21 2006 6:14 AM
Hi, i translated the c#-code which i found on the site, but i have to select a specific cell, the one in the 2nd columns of the grid that was created last. can someone  help me?!

[vb]

Dim nieuweRij As DataRow

nieuweRij = dtBestelling.NewRow

nieuweRij("soort") = rbknop.Text

nieuweRij("aantal") = 1

dtBestelling.Rows.Add(nieuweRij)

dgBestellingen.Focus()

'Focusing a particular cell in the Data Grid

Dim dgc As DataGridCell = New DataGridCell(1, 1)

dgBestellingen.CurrentCell = dgc

'so i need the cell in the 2nd column of the new addedrow
Dim
dgtb As DataGridTextBoxColumn = CType(dgBestellingen.TableStyles(0).GridColumnStyles(2), DataGridTextBoxColumn)

dgtb.TextBox.Focus()
[/vb]