创建复合材料和自定义网格控制在ASP.Net 2008或以上 [英] Create composite and custom grid control in ASP.Net 2008 or above

查看:168
本文介绍了创建复合材料和自定义网格控制在ASP.Net 2008或以上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请建议我如何创建复合网格。也就是说,我需要的GridView的所有功能中框架3.5及以上,还需要包括一些其他的功能,那grid.please建议我该怎么做。如果可能的话,请分享样品code。

Please suggest me how to create composite grid. ie , i need all the features of gridview in the Framework 3.5 and above,but also need to include some other functionality to that grid.please suggest me what to do . if possible please share sample code.

推荐答案

您需要扩展当前的GridView。例如:

You need to extend the current GridView. Example:

public class MySuperGridView : GridView
{

    public void CoolMethod()
    {
    }

    public string CoolProperty 
   {
       get{return ViewState["CoolProperty"]==null?null:(string)ViewState["CoolProperty"];}
       set {ViewState ["CoolProperty"]=value;}
   }
    //add more coolness here
}

现在就可以开始使用标准的asp.net的GridView的自定义的GridView,而不是

Now you can start using your custom Gridview instead of the standard asp.net GridView

这篇关于创建复合材料和自定义网格控制在ASP.Net 2008或以上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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