DevExpress的ASPxGridview控件,封装后,加了一些自有的代码进去,经测试功能都正常,但就是无法使用Dev控件的主题皮肤了,请高人帮忙。
下图是运行效果,其中灰色的是封装后的ASPxGridview控件,下方的是原生的ASPxgridview控件。俺只有200园豆豆了,全部拿出来答谢提供正确帮助的朋友。谢谢。
封装的代码:
[DevExpress.Utils.Design.DXClientDocumentationProvider("#AspNet/DevExpressWebASPxGridViewScripts"), Designer("DevExpress.Web.ASPxGridView.Design.GridViewDesigner, " + AssemblyInfo.SRAssemblyWebDesignFull), DevExpress.Utils.ToolboxTabName(AssemblyInfo.DXTabData)] public class ZiyuASPxGridView : DevExpress.Web.ASPxGridView.ASPxGridView, IWebDataOwner, IWebControlPageSettings, IWebDataEvents, IDataControllerSort, IWebColumnsOwner, IRequiresLoadPostDataControl, IPopupFilterControlOwner, IPopupFilterControlStyleOwner, ISummaryItemsOwner, IHeaderFilterPopupOwner, IPagerOwner { private string _sConfigName=""; /// <summary>页数</summary> [Browsable(true), Category("ziyu"), DefaultValue("当前表格配置名称"), Description("表格配置"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public virtual string sConfigName { get { return _sConfigName; } set { _sConfigName = value; } } private IManagePage _manager; [Browsable(true), Category("ziyu"), DefaultValue(null), Description("窗体控制器"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public IManagePage Manager { get { return _manager; } set { _manager = value; } } protected override void Render(HtmlTextWriter writer) { if (!PreRendered) { EnsureChildControls(); PrepareControlHierarchy(); } // CheckRequireDataBound(); base.Render(writer); } protected override void OnLoad(System.EventArgs e) { base.OnLoad(e); //this.Theme = Page.Theme; #region 界面配置代码,不可或缺。如需更多初始化代码,可在此基础上添加但绝不允许注释或跳过这些代码; base.Theme = this.Theme; if (!Page.IsPostBack & !IsCallback) { //本行代码,适用于所有使用ASPxGridview控件的窗体,不可删除或改变,只允许该控件名称和配置名称; ZiyuWeb.WebFunc.ZiyuDevHelper.configGridView(this, sConfigName, true, Manager); } #endregion #region 界面配置代码,如果使用aspxlistedit、gridlookup、dropdown等高级控件的时候,下面的代码必须使用; else ZiyuWeb.WebFunc.ZiyuDevHelper.initGridAspxListFild(this, e, sConfigName, this); #endregion } protected override void RaiseEditorInitialize(DevExpress.Web.ASPxGridView.ASPxGridViewEditorEventArgs e) { base.RaiseEditorInitialize(e); //本行代码,适用于所有使用ASPxGridview控件的窗体,不可删除或改变,只允许该控件名称和配置名称; #region 界面配置代码,不可或缺。如需更多初始化代码,可在此基础上添加但绝不允许注释或跳过这些代码; ZiyuWeb.WebFunc.ZiyuDevHelper.initGridCellEdit(this, e, sConfigName, this); #endregion } protected override void RaiseRowInserting(DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { base.RaiseRowInserting(e); ZiyuWeb.WebFunc.ZiyuDevHelper.gridviewInsert(this, e, sConfigName, (DevExpress.Web.ASPxGridView.ASPxGridView)this); } protected override void RaiseRowUpdating(DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { base.RaiseRowUpdating(e); #region 界面配置代码,如果使用aspxlistedit、gridlookup、dropdown等高级控件的时候,下面的代码必须使用; ZiyuWeb.WebFunc.ZiyuDevHelper.gridviewUpdate(this, e, sConfigName); #endregion } }
已搞定,小case。
搞定了也留个解决方案撒,以后遇到了好有方法。
http://q.cnblogs.com/q/56762/
求如何搞定的?