protected void Page_Load(object sender, EventArgs e) { this.EOCb_Search.Execute += this.EOCb_Search_Execute; this.EOCb_Accept.Execute += this.EOCb_Accept_Execute; //[-] try { this.mSelectionName = (string)this.ViewState[CnsSelectionName]; } catch { } try { this.mIsMultipleSelect = (this.ViewState[CnsIsMultipleSelect] != null) ? (bool)this.ViewState[CnsIsMultipleSelect] : false; } catch { } try { this.mDt_Selected = (DataTable)this.ViewState[CnsDt_Selected]; } catch { } try { this.mQuery_Selection = (string)this.ViewState[CnsQuery_Selection]; } catch { } //[-] System.Text.StringBuilder Sb_Js = new System.Text.StringBuilder(); Sb_Js.AppendLine(@"function Selection_Accept_" + this.ClientID + @"(dialog, arg) {"); Sb_Js.AppendLine(@" EOCb_BE_Selection_" + this.ClientID + @"();"); Sb_Js.AppendLine(@" var Grid = eo_GetObject('" + this.EOGrid_Selection.ClientID + "');"); Sb_Js.AppendLine(@" var Gi = Grid.getSelectedItem();"); Sb_Js.AppendLine(@" var Key = 0;"); Sb_Js.AppendLine(@" if(Gi != null) {"); Sb_Js.AppendLine(@" Key = Gi.getKey();"); Sb_Js.AppendLine(@" }"); Sb_Js.AppendLine(@" eo_Callback('" + this.EOCb_Accept.ClientID + "', Key);"); Sb_Js.AppendLine(@"}"); Sb_Js.AppendLine(@"function EOCb_BE_Selection_" + this.ClientID + "(callback) {"); Sb_Js.AppendLine(@" EOCb_BE();"); Sb_Js.AppendLine(@" var Grid = eo_GetObject('" + this.EOGrid_Selection.ClientID + "');"); Sb_Js.AppendLine(@" var Gc_IsSelect = Grid.getColumn('IsSelect');"); Sb_Js.AppendLine(@" var NoItems = Grid.getItemCount();"); Sb_Js.AppendLine(@" var Ct = 0;"); Sb_Js.AppendLine(@" var Selected = '';"); Sb_Js.AppendLine(@" var Comma = '';"); Sb_Js.AppendLine(@" for (Ct = 0; Ct <= (NoItems - 1); Ct++) {"); Sb_Js.AppendLine(@" var Gi = Grid.getItem(Ct);"); Sb_Js.AppendLine(@" var Gcl = Gi.getCell(Gc_IsSelect.getOriginalIndex());"); Sb_Js.AppendLine(@" var IsSelect = Gcl.getValue();"); Sb_Js.AppendLine(@" var Key = Gi.getKey();"); Sb_Js.AppendLine(@" Selected = Selected + Comma + Key + ',' + IsSelect;"); Sb_Js.AppendLine(@" Comma = ',';"); Sb_Js.AppendLine(@" }"); Sb_Js.AppendLine(@" document.getElementById('" + this.Hid_Selected.ClientID + "').value = Selected"); Sb_Js.AppendLine(@"}"); this.Page.ClientScript.RegisterClientScriptBlock(typeof(string), this.ClientID, Sb_Js.ToString(), true); this.EOCb_Search.ClientSideBeforeExecute = "EOCb_BE_Selection_" + this.ClientID; //[-] /* * this.Btn_NewSearch.Attributes.Add("onclick", @"eo_Callback('" + this.EOCb_Search.ClientID + @"','" + this.Btn_NewSearch.ID + @"'); return false;"); * this.Btn_AddSearch.Attributes.Add("onclick", @"eo_Callback('" + this.EOCb_Search.ClientID + @"','" + this.Btn_AddSearch.ID + @"'); return false;"); * this.Btn_SortAsc.Attributes.Add("onclick", @"eo_Callback('" + this.EOCb_Search.ClientID + @"','" + this.Btn_SortAsc.ID + @"'); return false;"); * this.Btn_SortDesc.Attributes.Add("onclick", @"eo_Callback('" + this.EOCb_Search.ClientID + @"','" + this.Btn_SortDesc.ID + @"'); return false;"); * this.Btn_Clear.Attributes.Add("onclick", @"eo_Callback('" + this.EOCb_Search.ClientID + @"','" + this.Btn_Clear.ID + @"'); return false;"); * this.Btn_Page.Attributes.Add("onclick", @"eo_Callback('" + this.EOCb_Search.ClientID + @"','" + this.Btn_Page.ID + @"'); return false;"); */ Layer01_Methods_Web_EO.BindEOCallBack(this.Btn_NewSearch, this.EOCb_Search, this.Page); Layer01_Methods_Web_EO.BindEOCallBack(this.Btn_AddSearch, this.EOCb_Search, this.Page); Layer01_Methods_Web_EO.BindEOCallBack(this.Btn_SortAsc, this.EOCb_Search, this.Page); Layer01_Methods_Web_EO.BindEOCallBack(this.Btn_SortDesc, this.EOCb_Search, this.Page); Layer01_Methods_Web_EO.BindEOCallBack(this.Btn_Clear, this.EOCb_Search, this.Page); Layer01_Methods_Web_EO.BindEOCallBack(this.Btn_Page, this.EOCb_Search, this.Page); Layer01_Methods_Web_EO.BindEOCallBack(this.Btn_CheckAll, this.EOCb_Search, this.Page); Layer01_Methods_Web_EO.BindEOCallBack(this.Btn_UncheckAll, this.EOCb_Search, this.Page); }