
Help: DBGrid - how to make DBGrid.row = current row when I click the a cell
Quote:
> Hi there,
> I tried to show the content of a cell when I click the cell in a
> DBGrid. The following is my code:
> MsgBox
> DBGrid1.Columns(DBGrid1.Col).CellText(DBGrid1.RowBookmark(DBGrid1.Row))
> But the msgbox only shows the cell content of the previous click.
> Anyway to make the dbgrid1.col and dbgrid1.row become the current row
> and col at the click moment????
> Many thanks!!
> Tasman :(
Tasman, a preferrable solution would be to put the code in
RowColChange. The only drawback is that it will not fire when you click
on current cell. If you want to do this in a click event you will have
to download an updated control (True DBGrid Standard, a free upgrade to
DBGrid) from our WWW site. The full url is:
http://www.apexsc.com/truedbgridstandard_download.html
Then you can do following:
Private Sub TDBGridS1_Click()
TDBGridS1.PostMsg 1
End Sub
Private Sub TDBGridS1_PostEvent(ByVal MsgId As Integer)
If MsgId = 1 Then MsgBox TDBGridS1
End Sub
Lac
--
Ladislav Sedivy
http://rabbit.apexsc.com