我如何访问我在gridview中单击的行 [英] how i can access to row that i clicked on it in gridview

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

问题描述

专家,
请帮助我,这对我来说非常重要,请上帝保佑您,对每个建议都敞开心胸
我有一个带有3个单元格的gridview,在第3个单元格中,我有一个按钮,当用户单击单击功能中的按钮时,我要访问选定的行和已绑定到gridview的数据,但是它没有显示在单元格中,我必须阅读它从数据绑定到gridview或说如果我使用linqdatasource如何访问选定的行.
我想在没有对象数据源的情况下执行此操作,因为我对SQL使用linq:

预先感谢您的答复.

hi experts,
plz help me its very essential for me,god bless you,im open for every suggestion
i have a gridview with 3 cell,in cell 3 i have a button i want when user clicks on button in click function i access to selected row and a data that has been bind to gridview but it didnt show in cells i have to read it from data bind to gridview or say if i use linqdatasource how can i access to selected row.
i want do it without object data source because i use linq to sql :

Thanks in advance for an answer.

protected void btnShowData(object sender, EventArgs e)
    {

        BLL.Posts.FillPosts(MyWebApplication.Sessions.AuthenticatedUser.UserID);

        Button btnShow = (Button)sender;

         if (linqDatasource != null)
        {
          ...?
            //  myRich.LoadContent(strTitle, strBody);

        }

推荐答案

YourDatagridview.SelectedCells无法正常工作?!!
YourDatagridview.SelectedCells will not work???!


SelectedRow [ ^ ]应该会给您答案.
SelectedRow[^] should give you the answer.


检查这些博客
通过单击行在Gridview中选择行 [ http://www.geekzilla.co.uk/view9FC28EE6-ACB0-4F51-BFE4- 38B0B10134D5.htm [ ^ ]
--NDK
check these blogs
Select a Row in a Gridview with a Click on Row[^]
http://www.geekzilla.co.uk/view9FC28EE6-ACB0-4F51-BFE4-38B0B10134D5.htm[^]
--NDK


这篇关于我如何访问我在gridview中单击的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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