如何创建一个继承自asp:Gridview的自定义GridView [英] How to create a custom GridView which inherits from asp:Gridview
本文介绍了如何创建一个继承自asp:Gridview的自定义GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用onsorting =GridView1_SortingOnRowDataBound =GridView1_RowDataBound属性创建了一个asp网格视图。
现在我想将这个Gridview移动到用户控件,以便我可以在其他页面中重用它
还指导我如何将DataSource绑定到我的用户控件网格以及它如何调用asp:grids databind来绑定数据源。
I created a asp grid view with onsorting="GridView1_Sorting" OnRowDataBound="GridView1_RowDataBound" properties.
now I want to move this Gridview to a user control so that I can reuse it in other pages
Also guide me how to bind a DataSource to my user control grid and how it calls asp:grids databind to bind the datasource.
推荐答案
创建一个新类并使其继承原始gridview,然后在构造函数上添加新的排序。你的新网格。
Create a new class and make it inherit the original gridview, then add on the constructor your new sorting. Theres your new grid.
这篇关于如何创建一个继承自asp:Gridview的自定义GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文