在Gridview中需要帮助? [英] Need Help in Gridview?

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

问题描述

当我从父网格视图中选择相应的行时,我有父网格视图子网格视图儿童gridview。我希望用户传递一个指向 ParentGridview 第10条记录的网址,该网址会在gridview中打开超过100行的 ChildGridview 。所以需要传递查询字符串,如http://test/pages/all.aspx?PId = 10所以它应该指向第10条记录,并在页面上打开子Gridviw。

i have Parent gridview and child gridview when i m selecting row from parent gridview accordingly it fill child gridview. i want user to pass a url which point to 10th record of ParentGridview which opens ChildGridview with more than 100 rows in gridview. so need to pass querystring like http://test/pages/all.aspx?PId=10 so it should point to 10th record aloong with child Gridviw open on the page.

怎么能我这样做。

推荐答案

你好,

你可以通过几个步骤实现....

1.在父网格视图中的gridview中使用ItemTamplate ItemIamplate添加子网格视图。
2.在页面加载绑定父网格视图。
3。绑定后添加类似-----

int intinin = Convert.ToInt32(Request.QueryString [" PId"]);的字符串parentID =((Label)gvFirst.Rows [ pageindex-1] .FindControl(" parentID"))。Text; //子外键值
GridView gg =(GridView)gvFirst.Rows [pageindex - 1] .FindControl(" gvChild"); / / child gridview
FillChild(parentID,gg); //子网格视图的绑定方法

关于
AnupDG
Hi,

You can achieve in few steps....

1. Use ItemTamplate in the gridview in the parent gridview ItemIamplate addthe child gridview.
2. in page load bind the parent gridview.
3. After binding add the code like-----

            int pageindex = Convert.ToInt32(Request.QueryString["PId"]);
            string parentID = ((Label)gvFirst.Rows[pageindex-1].FindControl("parentID")).Text;// Child foreign key value
            GridView gg = (GridView)gvFirst.Rows[pageindex - 1].FindControl("gvChild");//child gridview
            FillChild(parentID, gg);//binding method for the child gridview

Regards
AnupDG


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

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