|
6#
楼主 |
发表于 2015-1-6 10:15:23
|
只看该作者
页面表格工具栏
- <Toolbars>
- <f:Toolbar runat="server" ID="Toolbar1" CssStyle="line-height:1px;">
- <Items>
- <f:DropDownList runat="server" ID="ddlDIVID" LabelWidth="50px" OnSelectedIndexChanged="ddlDIVID_SelectedIndexChanged" Label="单位" AutoPostBack="True" Width="300px"></f:DropDownList>
- <f:Button runat="server" ID="btnSure" OnClick="btnSure_Click" Text="确定"></f:Button>
- </Items>
- </f:Toolbar>
- </Toolbars>
复制代码
下拉框的数据源绑定
- #region 单位绑定
- /// <summary>
- /// 单位绑定
- /// </summary>
- /// <param name="ddl"></param>
- /// <param name="userid"></param>
- public void ddlDivBind(FineUI.DropDownList ddl,string userid)
- {
- DataTable dtable = new SelectHelper().SelectUserTable("t_division", " and ((nid in (select divid from t_usertodiv where userid='" + userid + "')))" + " order by nid", null).Tables[0];
- ddl.DataSource = DDLTree(dtable);
- ddl.DataSimulateTreeLevelField = "level";
- ddl.EnableSimulateTree = true;
- ddl.EnableEdit = true;
- ddl.ForceSelection = true; //模糊查询设置
- ddl.DataValueField = "DIVID";
- ddl.DataTextField = "NAME";
- ddl.DataBind();
- if (dtable.Rows.Count > 0)
- {
- ddl.SelectedIndex = 0;
- }
- }
- #endregion
复制代码
调用方法
- new Audit_BLL.BLL_CommonMsgShow().ddlDivBind(ddlDIVID, CurrentUser.PkId); //单位绑定
复制代码
选择下拉框触发:
- protected void ddlDIVID_SelectedIndexChanged(object sender, EventArgs e)
- {
- Grid1.PageIndex = 0;
- dataBind();
- }
复制代码
这样的代码有什么为题。正常的绑定触发 |
|