如何在dataGridview中获取选定的行值 [英] how to get the selected row value in dataGridview

查看:70
本文介绍了如何在dataGridview中获取选定的行值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi



如何获取datagridview中所选行值的内容。

解决方案

是google坏了?



从datagridview中的选定行获取值 [ ^ ]

DataGridView选择行的列值到文本框 [ ^ ]

http://social.msdn.microsoft.com/Forums/en- US / 8df01b20-c427-4755-bc9d-e173d69a65a9 / how-to-values-from-datagridview-row?forum = Vsexpressvb [ ^ ]

http:/ /stackoverflow.com/questions/11260843/getting-data-from-selected-datagridview-row-and-which-event [ ^ ]


见以下链接: -



从datagridview中的选定行获取值 [ ^ ]


你应该使用OnRowCommand并使用链接按钮,



  protected   void  rowwcommandname( object  sender,GridViewCommandEventArgs e)
{
if (e.CommandName == 命令名称
{
string [] DCdata = e.CommandArgument.ToString()。Split(' ,');
< here you = can = play = with = = data = < span class =code-keyword>>

}
} < / 此处 >



绑定模板----- < br $>




 <   ItemTemplate  >  
< 二v style = float:left;保证金:7px 0; >
< asp:LinkBut​​ton ID = btnEmail runat = server < span class =code-attribute>文字 = <%

hi

how to get the content of selected row value in datagridview.

解决方案

Is google broken?

get value from selected rows in datagridview[^]
DataGridView selected row's column values to textbox[^]
http://social.msdn.microsoft.com/Forums/en-US/8df01b20-c427-4755-bc9d-e173d69a65a9/how-to-get-values-from-datagridview-row?forum=Vsexpressvb[^]
http://stackoverflow.com/questions/11260843/getting-data-from-selected-datagridview-row-and-which-event[^]


see below link:-

get value from selected rows in datagridview[^]


You should use OnRowCommand and use link button,

protected void rowwcommandname(object sender, GridViewCommandEventArgs e)
   {
       if (e.CommandName == "name of the command")
       {
           string[] DCdata = e.CommandArgument.ToString().Split(',');
<here you="" can="" play="" with="" the="" data="">
                    
       }
   }</here>


Bind Template -----


<ItemTemplate>
                                        <div style="float:left; margin:7px 0;">
                                            <asp:LinkButton ID="btnEmail" runat="server" Text="<%


这篇关于如何在dataGridview中获取选定的行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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