请问如何获取datagrid具体某一行某一列的值

shiyan321sun1 2004-12-20 10:11:15
请问如何获取datagrid具体某一行某一列的值
在线等待
...全文
183 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cindytsai 2004-12-20
  • 打赏
  • 举报
回复
某一条记录:'保持数据一致性
Private Sub DataGrid1_Click()
DataGrid1.Refresh
If Adodc1.Recordset.EOF Then
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "库中没有记录。"
Exit Sub
End If
Adodc1.Recordset.MoveFirst
End If
Text3.Visible = False
Label4.Visible = True
Text1.Text = Adodc1.Recordset(0)
Text2.Text = Adodc1.Recordset(1)
End Sub
heiheidan 2004-12-20
  • 打赏
  • 举报
回复
Private Sub DG_DblClick()
MsgBox DG.Text
End Sub
ljhdi 2004-12-20
  • 打赏
  • 举报
回复
Private Sub grdDataGrid_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
'If Not Adodc1.Recordset.EOF And Not Adodc1.Recordset.BOF Then
grdDataGrid.row = 8
Text3.Text = grdDataGrid.Columns(0)
'End If
End Sub
tianll 2004-12-20
  • 打赏
  • 举报
回复
上面这个是放在单击事件或者双击时间里的
tianll 2004-12-20
  • 打赏
  • 举报
回复
DataGrid1.Columns.Item("列标题").Value
shiyan321sun1 2004-12-20
  • 打赏
  • 举报
回复
to :ljhdi

.row
.col 里的数值怎么取啊,如我想取出第0列第8行的数值
ljhdi 2004-12-20
  • 打赏
  • 举报
回复
.row
.col

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧