public void Setup( ClsSysCurrentUser CurrentUser , List<ClsBindGridColumn> BindDefinition , DataTable Dt_Source , RadAjaxPanel RadAjaxPanel_Target , string ModuleName = "" , bool IsPersistent = true) { this.mProperties = new Control_Filter_Properties(); this.mProperties.BindDefinition = BindDefinition; this.mProperties.Dt_Filter = new DataTable(); this.mProperties.RadAjaxPanel_Target_ClientID = RadAjaxPanel_Target.ClientID; this.mProperties.ModuleName = ModuleName != "" ? CnsState_Filter + ModuleName : CnsState_Filter + this.Page.Request.Url.AbsolutePath; this.mProperties.IsPersistent = IsPersistent; this.ViewState[CnsProperties] = this.mProperties; //[-] this.mProperties.Dt_Filter.Columns.Add("Desc", typeof(string)); this.mProperties.Dt_Filter.Columns.Add("Field", typeof(string)); this.mProperties.Dt_Filter.Columns.Add("DataType", typeof(string)); foreach (ClsBindGridColumn Gc in this.mProperties.BindDefinition) { if (Gc.mIsFilter && (Gc.mFieldName != "")) { try { Do_Methods.AddDataRow( ref this.mProperties.Dt_Filter , new string[] { "Field", "Desc", "DataType" } , new object[] { Gc.mFieldName, Gc.mFieldDesc, Dt_Source.Columns[Gc.mFieldName].DataType.ToString() }); } catch { } } } Methods_Web.BindCombo(ref this.Cbo_Filter, this.mProperties.Dt_Filter, "Field", "Desc"); //[-] if (this.mProperties.IsPersistent) { this.mState = (Control_Filter_State)this.Session[this.mProperties.ModuleName]; if (this.mState == null) { this.mState = new Control_Filter_State(); this.Session[this.mProperties.ModuleName] = this.mState; } } else { this.mState = new Control_Filter_State(); this.ViewState[CnsState_Filter] = this.mState; } //[-] this.UpdateFilterLabel(); }
void Page_Load(object sender, EventArgs e) { this.RadAjaxPanel_FilterLabel.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxPanel_FilterLabel_AjaxRequest); if (!this.IsPostBack) { this.SetupPage_Attributes(); } else { this.mProperties = (Control_Filter_Properties)this.ViewState[CnsProperties]; if (this.mProperties.IsPersistent) { this.mState = (Control_Filter_State)this.Session[this.mProperties.ModuleName]; } else { this.mState = (Control_Filter_State)this.ViewState[CnsState_Filter]; } } this.SetupPage_AjaxPanelEventHandler(); }