how to obtain the positon of the row in the data set

G

Guest

hi all, i have a master detail form. In the datagrid control i have the following code

Private Sub dtgCobD_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtgCobD.CurrentCellChange
Dim Val As Intege
MessageBox.Show("Col is " & dtgCobD.CurrentCell.ColumnNumber
& ", Row is " & dtgCobD.CurrentCell.RowNumber
& ", Value is " & dtgCobD.Item(dtgCobD.CurrentCell)
Val = dtgCobD.Item(dtgCobD.CurrentCell.RowNumber, 0
If dtgCobD.CurrentCell.ColumnNumber = 2 The
frmDoc1.ShowDialog(
Dst1.Tables("CobD").Rows(0)(2) = frmDoc1.va
End I
End Su

i want to modify the current cell of the datagrid control with the value of frmdoc1.val but i don't know how to obtain the positon of the row in the data set. Please help...
 
C

CJ Taylor

use a currency manager

dim cm as currencymanager
dim dsRowposition as integer

cm = bindingcontext(mydataset, "mydatatable")

dsRowposition = cm.position

cm = nothing

I want to hear nothing about my "casing" herfried...
=)


Carmen de Lara said:
hi all, i have a master detail form. In the datagrid control i have the following code:

Private Sub dtgCobD_CurrentCellChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles dtgCobD.CurrentCellChanged
Dim Val As Integer
MessageBox.Show("Col is " & dtgCobD.CurrentCell.ColumnNumber _
& ", Row is " & dtgCobD.CurrentCell.RowNumber _
& ", Value is " & dtgCobD.Item(dtgCobD.CurrentCell))
Val = dtgCobD.Item(dtgCobD.CurrentCell.RowNumber, 0)
If dtgCobD.CurrentCell.ColumnNumber = 2 Then
frmDoc1.ShowDialog()
Dst1.Tables("CobD").Rows(0)(2) = frmDoc1.val
End If
End Sub

i want to modify the current cell of the datagrid control with the value
of frmdoc1.val but i don't know how to obtain the positon of the row in the
data set. Please help...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top