当前位置: 首页>>代码示例>>C#>>正文


C# ASPxComboBox.DataBindItems方法代码示例

本文整理汇总了C#中ASPxComboBox.DataBindItems方法的典型用法代码示例。如果您正苦于以下问题:C# ASPxComboBox.DataBindItems方法的具体用法?C# ASPxComboBox.DataBindItems怎么用?C# ASPxComboBox.DataBindItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ASPxComboBox的用法示例。


在下文中一共展示了ASPxComboBox.DataBindItems方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FillCombo_OLD_SYSTEM

    protected void FillCombo_OLD_SYSTEM(ASPxComboBox cmb, string SYS_CODE)
    {
        try
        {
            if (string.IsNullOrEmpty(SYS_CODE)) return;
            string SQL = "";
            SQL = " SELECT  CTLT_SYS_USER_RIGHT.USER_RIGHT ROLE_ID";
            SQL += " ,SYS_CODE";
            SQL += " ,CTLT_USER_RIGHT.USER_RIGHT_DESC ROLE_NAME";
            SQL += " FROM CTLT_SYS_USER_RIGHT ";
            SQL += " LEFT JOIN CTLT_USER_RIGHT ON CTLT_USER_RIGHT.USER_RIGHT = CTLT_SYS_USER_RIGHT.USER_RIGHT";
            SQL += " WHERE SYS_CODE='" + SYS_CODE + "'";

            //string SQL = string.Format("select ROLE_ID,ROLE_NAME from ODS_SYSTEM_ROLE WHERE SYS_CODE='{0}' ORDER BY [ROLE_NAME]", SYS_CODE);
            SqlDataAdapter DA = new SqlDataAdapter(SQL, OPM_BL.DefaultConnectionString);
            DataTable DTRole = new DataTable();
            DA.Fill(DTRole);
            cmb.DataSource = DTRole;
            cmb.ValueField = "ROLE_ID";
            cmb.TextField = "ROLE_NAME";
            cmb.DataBindItems();

            //AccessDataSource2.FilterExpression = "  SYS_CODE='" + SYS_CODE + "'";
            //DataView dv = (DataView)AccessDataSource2.Select(DataSourceSelectArguments.Empty);
            //DataTable DT = dv.ToTable();
        }
        catch (Exception ex)
        {

        }
    }
开发者ID:TIT-tech,项目名称:OPM_BO,代码行数:31,代码来源:CTLT_EMP.aspx.cs

示例2: FillCombo

    protected void FillCombo(ASPxComboBox cmb, string SYS_CODE)
    {
        try
        {
            if (string.IsNullOrEmpty(SYS_CODE)) return;
            //AccessDataSource2.SelectParameters.Clear();
            ////string SQL = AccessDataSource2.SelectCommand;
            //AccessDataSource2.SelectCommand = " select SYS_CODE ,ROLE_ID,ROLE_NAME from ODS_SYSTEM_ROLE  ";
            //AccessDataSource2.SelectCommand = SQL;

            string SQL = string.Format("select ROLE_ID,ROLE_NAME from ODS_SYSTEM_ROLE WHERE SYS_CODE='{0}' ORDER BY [ROLE_NAME]", SYS_CODE);
            SqlDataAdapter DA = new SqlDataAdapter(SQL, OPM_BL.DefaultConnectionString);
            DataTable DTRole = new DataTable();
            DA.Fill(DTRole);
            cmb.DataSource = DTRole;
            cmb.ValueField = "ROLE_ID";
            cmb.TextField = "ROLE_NAME";
            cmb.DataBindItems();

            //AccessDataSource2.FilterExpression = "  SYS_CODE='" + SYS_CODE + "'";
            //DataView dv = (DataView)AccessDataSource2.Select(DataSourceSelectArguments.Empty);
            //DataTable DT = dv.ToTable();
        }
        catch (Exception ex)
        {

        }
    }
开发者ID:TIT-tech,项目名称:OPM_BO,代码行数:28,代码来源:Default2.aspx.cs

示例3: FillSectionCombo

 protected void FillSectionCombo(ASPxComboBox cmb, string SiteID)
 {
     if (SiteID == "0") return;
     cmb.DataSourceID = "ObjectDataSourceSection";
     ObjectDataSourceSection.SelectParameters[0].DefaultValue = SiteID;
     cmb.DataBindItems();
     cmb.Items.Insert(0, new ListEditItem("", null)); // Null Item
 }
开发者ID:ramyothman,项目名称:RBM,代码行数:8,代码来源:Manage.aspx.cs

示例4: BindDropDown

        /// <summary>
        /// Binds the DataTable to ComboBox list with given value and text fields
        /// </summary>
        /// <param name="cmbBox">Name of the ComboBox list to process</param>
        /// <param name="dt">DataTable to Bind</param>
        /// <param name="strValue">Value field name as string</param>
        /// <param name="strText">Text fiels name as string</param>
        public static void BindDropDown(ASPxComboBox cmbBox, DataTable dt, string strValue, string strText)
        {
            // clsDataFunctionsBAL objFunctions = null;

            try
            {
                if (DataTableHasRows(dt))
                {
                    cmbBox.DataSource = dt;
                    cmbBox.ValueField = strValue;
                    cmbBox.TextField = strText;
                    cmbBox.DataBindItems();
                }
            }
            catch (Exception ex)
            {
                //objFunctions = new clsDataFunctionsBAL();
                //objFunctions.SaveErrorLog(ex.Message, m_strModule, MethodBase.GetCurrentMethod().Name);
            }
            finally
            {
               // objFunctions = null;
            }
        }
开发者ID:vijaymca,项目名称:Dotnet,代码行数:31,代码来源:clsUtils.cs


注:本文中的ASPxComboBox.DataBindItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。