本文整理汇总了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)
{
}
}
示例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)
{
}
}
示例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
}
示例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;
}
}