Gridview请点击 [英] Gridview Click

查看:64
本文介绍了Gridview请点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我正在使用gridview,我该怎么办....当我单击gridview行时,该行的所有数据都将显示在文本框中.



请帮帮我!

Hie!

i am using gridview how can i do ....when i am clicking on gridview row that time all the data of that row will display in textboxes.



Please Help Me !

推荐答案

是这样的吗?
Something like this?
Private Sub DataGridView1_RowHeaderMouseClick(ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs) Handles DataGridView1.RowHeaderMouseClick

   Dim sel as Integer
   Me.leftclick = (e.Button = Windows.Forms.MouseButtons.Left)
   If Me.leftclick = True Then
      
      sel = DataGridView1.CurrentCell.RowIndex
      Textbox1.Txt = DataGridView1.Rows(sel).Cells(0).Value
      .....
      ''Or make a loop

   End If
End Sub


您尝试搜索Google吗?

使用选择CommandField"选择一行并获取相应的值.搜索详细信息. :thumbsup:
Did you try searching Google?

Use "Select CommandField" to select a row and get the corresponding values. Do a search for the details. :thumbsup:


首先告诉我们是Web还是Windows应用程序?

(对于ASP.Net)
然后,是否要让文本框显示在所选行的gridview内?
如果是,则必须使用ItemTemplate将文本框放在gridview中.
进行一些Google搜索,您会找到许多有关此操作的链接.
Firstly tell us whether it is Web or Windows appl''n?

(For ASP.Net)
Then, do you want textboxes to display inside gridview on the selected row?
If yes, then you have to use ItemTemplate to put textboxes inside gridview.
Do some google search, you''ll find many links on how to do this.


这篇关于Gridview请点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆