Exemplo n.º 1
0
        private void Register_CallBack_Qty_Action()
        {
            //结合控件
            UFSoft.UBF.UI.WebControls.Association.AssociationControl ac = new AssociationControl();
            ac.SourceServerControl = (UFSoft.UBF.UI.ControlModel.IUFDataGrid) this.DataGrid5;
            //设定事件名称,经验证区分大小写,可查看portal\js\对应控件.js
            //事件名参考\Portal\js\DataGrid.js,<!--DataGrid控件事件名称常量定义--> 节点
            //DataGrid事件,OnBeforeCellFocusEnter等验证能触发
            ac.SourceControl.EventName = "OnCellDataChanged";
            //查看事件的方法
            //UFSoft.UBF.UI.WebControls.Association.UFDateGridEventName.OnCellFocusEnter

            //加入触发事件的列名,先转成Adapter
            UFSoft.UBF.UI.WebControls.Association.Adapter.UFWebClientGridAdapter adapter1 = ((UFWebClientGridAdapter)ac.SourceControl);
            adapter1.FireEventCols.Add("ThisCancelQty");

            //客户端刷新框架
            ClientCallBackFrm cF = new ClientCallBackFrm();

            //加入相关控件(才可取其值)
            cF.ParameterControls.Add((IUFControl)this.DataGrid5);
            cF.Add(ac);

            //加事件
            cF.DoCustomerAction += new ClientCallBackFrm.ActionCustomer(cF_DoCustomerAction);
        }
Exemplo n.º 2
0
        private void Register_PostBack_DataGrid_OnCellClick()
        {
            //结合控件
            UFSoft.UBF.UI.WebControls.Association.AssociationControl ac = new UFSoft.UBF.UI.WebControls.Association.AssociationControl();
            //设定触发源
            ac.SourceServerControl = this.DataGrid0;
            //设定事件名称
            //事件名参考\Portal\js\DataGrid.js,<!--DataGrid控件事件名称常量定义--> 节点
            ac.SourceControl.EventName = "OnRowChanged";
            //查看事件的方法
            //UFSoft.UBF.UI.WebControls.Association.UFDateGridEventName.OnCellDataChanged
            //触发Postback事件的列,不加此代码则全部列均触发事件
            //((IUFClientAssoGrid)ac.SourceControl).FireEventCols.Add("Subject");

            //PostBack处理方案
            //Grid适配器
            UFSoft.UBF.UI.WebControls.Association.Adapter.UFWebClientGridAdapter adapter1 = new UFSoft.UBF.UI.WebControls.Association.Adapter.UFWebClientGridAdapter(ac.SourceServerControl);
            adapter1.IsPostBack  = true;
            adapter1.PostBackTag = this.DataGrid0.ClientID + "_" + ac.SourceControl.EventName;

            //代码块
            UFSoft.UBF.UI.WebControls.Association.CodeBlock cb = new UFSoft.UBF.UI.WebControls.Association.CodeBlock();
            //目标控件中加入Adapter
            cb.TargetControls.addControl(adapter1);

            //结合控件中加入代码块
            ac.addBlock(cb);

            //注册事件(此处UFGrid与上面的设定触发源IUFControl一致)
            UFSoft.UBF.UI.WebControls.UFGrid u1 = (UFSoft.UBF.UI.WebControls.UFGrid) this.DataGrid0;
            u1.GridCustomerPostBackEvent += new UFSoft.UBF.UI.WebControls.GridCustomerPostBackDelegate(PostBack_DataGrid_OnCellClick);
        }
Exemplo n.º 3
0
        private void Register_CallBack_Fee_DoCustomerAction()
        {
            //结合控件
            UFSoft.UBF.UI.WebControls.Association.AssociationControl ac = new AssociationControl();
            //设定触发源(可以设定多个,如多事件触发)
            ac.SourceServerControl     = (UFSoft.UBF.UI.ControlModel.IUFDataGrid) this.DataGrid5;
            ac.SourceControl.EventName = "OnCellDataChanged";
            //加入触发事件的列名,先转成Adapter
            UFSoft.UBF.UI.WebControls.Association.Adapter.UFWebClientGridAdapter adapter1 = ((UFWebClientGridAdapter)ac.SourceControl);
            adapter1.FireEventCols.Add("DiscountType"); //折扣方式
            adapter1.FireEventCols.Add("Discount");     //折扣
            adapter1.FireEventCols.Add("Prices");       //价格
            //客户端刷新框架
            ClientCallBackFrm cF = new ClientCallBackFrm();

            //加入相关控件(才可取其值)
            cF.ParameterControls.Add((IUFControl)this.DataGrid5);
            cF.Add(ac);
            //加事件
            cF.DoCustomerAction += new ClientCallBackFrm.ActionCustomer(cF_DoCustomerAction);
        }