本文整理汇总了C#中ASPxComboBox.DataBind方法的典型用法代码示例。如果您正苦于以下问题:C# ASPxComboBox.DataBind方法的具体用法?C# ASPxComboBox.DataBind怎么用?C# ASPxComboBox.DataBind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASPxComboBox
的用法示例。
在下文中一共展示了ASPxComboBox.DataBind方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetDDLPOSTYPE
public static void SetDDLPOSTYPE(ASPxComboBox ddl)
{
try
{
string sql = "select POS_TYPE,POS_TYPE_NAME from PSST_POS_TYPE order by POS_TYPE_NAME";
DataTable dt = GetDatatable(sql, null);
if (dt.Rows.Count > 0)
{
ddl.ValueField = "POS_TYPE";
ddl.TextField = "POS_TYPE_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例2: SetDDLPosition
public static void SetDDLPosition(ASPxComboBox ddl)
{
try
{
string sql = "select POS_ID,POS_NAME + '(' + POS_ID + ')' POS_NAME from vw_CMN_POSITION ";
SqlDataAdapter da = new SqlDataAdapter(sql, StaticDefaultConnectionString);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
ddl.ValueField = "POS_ID";
ddl.TextField = "POS_NAME";
ddl.DataSource = dt;
ddl.DataBind();
ddl.SelectedIndex = 0;
}
}
catch (Exception ex)
{
}
}
示例3: Set_DDLORG_LV1_2
public static void Set_DDLORG_LV1_2(ASPxComboBox ddl)
{
try
{
string sql = "select * from (select 'A' as Group1 , ORG_SERIAL,ORG_NAME,ORG_ABBR from vw_SMM_ORG_LEVEL1 union " + Environment.NewLine;
sql += "select 'B' as Group1 ,ORG_SERIAL,ORG_NAME,ORG_ABBR from vw_SMM_ORG_LEVEL2 ) as TB where 1=1" + Environment.NewLine;
sql += "order by Group1,ORG_SERIAL";
SqlDataAdapter da = new SqlDataAdapter(sql, StaticDefaultConnectionString);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
ddl.Columns.Clear();
ddl.ValueField = "ORG_SERIAL";
ddl.TextField = "ORG_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例4: SetDDLORGL3
public static void SetDDLORGL3(ASPxComboBox ddl)
{
try
{
string sql = "SELECT ORG_SERIAL,ORG_NAME,ORG_ABBR FROM vw_SMM_ORG WHERE ORG_LEVEL IN(3) order by ORG_NAME";
SqlDataAdapter da = new SqlDataAdapter(sql, StaticDefaultConnectionString);
DataTable dt = new DataTable();
da.Fill(dt);
DataRow row;
row = dt.NewRow();
//row["ORG_SERIAL"] = "0";
//row["ORG_NAME"] = "--ALL--";
//row["ORG_ABBR"] = "";
//dt.Rows.InsertAt(row, 0);
if (dt.Rows.Count > 0)
{
ddl.Columns.Clear();
ddl.Columns.Add("ORG_NAME", "ชื่อหน่วยงาน");
//ddl.Columns.Add("ORG_ABBR", "ชื่อย่อ");
ddl.ValueField = "ORG_SERIAL";
ddl.TextField = "ORG_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例5: SetDDLPerType
public static void SetDDLPerType(ASPxComboBox ddl)
{
try
{
//string sql = "select PER_TYPE,PER_TYPE_NAME from PSST_PER_TYPE where ORDER_SEQ is not null order by PER_TYPE";
string sql = " SELECT SP.PER_TYPE ,PT.PER_TYPE_NAME"+Environment.NewLine;
sql += " FROM SMM_PER_TYPE SP"+Environment.NewLine;
sql += " INNER JOIN PSST_PER_TYPE PT ON SP.PER_TYPE=PT.PER_TYPE"+Environment.NewLine;
SqlDataAdapter da = new SqlDataAdapter(sql, StaticDefaultConnectionString);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
ddl.ValueField = "PER_TYPE";
ddl.TextField = "PER_TYPE_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例6: SetDDLJDEVALITEM
public static void SetDDLJDEVALITEM(ASPxComboBox ddl, int TypeID)
{
try
{
string sql = "select * from SMM_JD_EVAL_ITEM where TYPE_ID=" + TypeID;
SqlDataAdapter da = new SqlDataAdapter(sql, StaticDefaultConnectionString);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
ddl.ValueField = "ITEM_ID";
ddl.TextField = "ITEM_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例7: SetDDLJDSUBGROP34
public static void SetDDLJDSUBGROP34(ASPxComboBox ddl,int GroupID)
{
try
{
string sql = "SELECT SUB_GROUP_ID,SUB_GROUP_NAME FROM SMM_JD_SUB_GROUP34 WHERE GROUP_ID="+ GroupID ;
SqlDataAdapter da = new SqlDataAdapter(sql, StaticDefaultConnectionString);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
ddl.ValueField = "SUB_GROUP_ID";
ddl.TextField = "SUB_GROUP_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例8: SetDDLPERSON
protected void SetDDLPERSON(ASPxComboBox ddl)
{
try
{
//string sql = "SELECT ID,PREFIX_NAME + PER.NAME + ' ' + PER.SURNAME PER_FULLNAME ";
//sql += " FROM PSST_PERSON PER ";
//sql += " INNER JOIN CTLT_PREFIX_CODE PF ON PER.PREFIX_CODE=PF.PREFIX_CODE";
//sql += " WHERE PER_STATUS='1' AND RETIRE_DATE>GetDate() AND PER_TYPE=11 ORDER BY PER.NAME,PER.SURNAME";
string sql = "select ID,PREFIX_NAME + NAME + ' ' + SURNAME PER_FULLNAME from vw_CMN_PERSON ";
sql += " Where RETIRE_DATE>GetDate() AND PER_TYPE=11 AND POS_ID IS NOT NULL";
sql += " order by name,surname";
DataTable dt = new DataTable();
dt = OPM_BL.GetDatatable(sql, null);
if (dt.Rows.Count > 0)
{
ddl.Columns.Clear();
ddl.Columns.Add("ID", "เลขที่");
ddl.Columns.Add("PER_FULLNAME", "ชื่อ");
ddl.ValueField = "ID";
ddl.TextField = "PER_FULLNAME";
ddl.DataSource = dt;
ddl.DataBind();
//ddl.SelectedIndex = 0;
}
}
catch (Exception ex)
{
}
}
示例9: InstantiateIn
public void InstantiateIn(Control container)
{
Control control = new Control();
control.ID = "GroupDetectorEditForm";
container.Controls.Add(control);
DataTable dt = datafield;
string db_name = "";
string desc_name = "";
string auth = "";
string cell_type = "";
ASPxFormLayout editform_GroupDetector = new ASPxFormLayout();
editform_GroupDetector.ID = "editform_GroupDetector";
//editform_GroupDetector.Border.BorderWidth = Unit.Pixel(1);
//editform_GroupDetector.SettingsItems.VerticalAlign = FormLayoutVerticalAlign.Middle;
//editform_GroupDetector.SettingsItems.HorizontalAlign = FormLayoutHorizontalAlign.Center;
editform_GroupDetector.Paddings.Padding = Unit.Pixel(8);
foreach (DataRow dr in dt.Select("AUTH <> 'System'", "VIEW_SEQ"))
{
db_name = dr["DB_NAME"].ToString();
desc_name = dr["DESC_NAME"].ToString();
auth = dr["AUTH"].ToString();
cell_type = dr["SEL_TYPE"].ToString();
LayoutItem li = new LayoutItem(desc_name);
li.FieldName = db_name;
editform_GroupDetector.Items.Add(li);
LayoutItemNestedControlContainer li_container = li.LayoutItemNestedControlContainer;
if (auth == "Manager")
{
li.CaptionStyle.Font.Bold = true;
li.CaptionStyle.ForeColor = Color.Red;
}
if (cell_type == "DropDown List")
{
ASPxDropDownEdit dropdownEdit = new ASPxDropDownEdit();
dropdownEdit.ID = db_name;
ASPxComboBox comboBox = new ASPxComboBox();
comboBox.DataSource = Srch_DropDownItem(db_name);
comboBox.TextField = "LOOKUPDETDESC";
comboBox.DataBind();
comboBox.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
comboBox.DropDownStyle = DropDownStyle.DropDown;
comboBox.EnableSynchronization = DevExpress.Utils.DefaultBoolean.False;
li_container.Controls.Add(comboBox);
}
else if (cell_type == "Note")
{
ASPxMemo textMemo = new ASPxMemo();
textMemo.ID = db_name;
textMemo.Width = Unit.Percentage(91);
li_container.Controls.Add(textMemo);
}
else
{
ASPxTextBox textBox = new ASPxTextBox();
textBox.ID = db_name;
li_container.Controls.Add(textBox);
//Suffix 증가 유무 체크 (15.10.16)
if (db_name == "CNT")
{
li = new LayoutItem("Suffix");
li.FieldName = "DETECTOR_SUFFIX";
editform_GroupDetector.Items.Add(li);
li_container = li.LayoutItemNestedControlContainer;
ASPxCheckBox chkBox = new ASPxCheckBox();
chkBox.ID = "DETECTOR_SUFFIX";
li_container.Controls.Add(chkBox);
}
}
}
container.Controls.Add(editform_GroupDetector);
//container.Controls.Add(editform_GroupDetector);
//Button
ASPxFormLayout btn_lo = new ASPxFormLayout();
btn_lo.ID = "button_GroupDetector";
btn_lo.ColCount = 1;
btn_lo.Width = Unit.Percentage(90);
btn_lo.SettingsItems.HorizontalAlign = FormLayoutHorizontalAlign.Right;
btn_lo.Paddings.Padding = Unit.Pixel(1);
LayoutItem btn_li = new LayoutItem("btn_li");
//.........这里部分代码省略.........
示例10: Set_DDLORG_LV3
public static void Set_DDLORG_LV3(ASPxComboBox ddl)
{
try
{
string sql = "select ORG_SERIAL,ORG_NAME,ORG_ABBR from vw_SMM_ORG_LEVEL2 order by ORG_SERIAL";
SqlDataAdapter da = new SqlDataAdapter(sql, DefaultConnectionString);
DataTable dt = new DataTable();
da.Fill(dt);
DataRow row;
row = dt.NewRow();
row["ORG_NAME"] = "ทั้งหมด";
dt.Rows.InsertAt(row, 0);
if (dt.Rows.Count > 0)
{
ddl.Columns.Clear();
ddl.ValueField = "ORG_SERIAL";
ddl.TextField = "ORG_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例11: Show_SetDDLTimeRule
public static void Show_SetDDLTimeRule(ASPxComboBox ddl)
{
try
{
string sql = "select time_code,time_name from PSST_TIME_RULE where TIME_STATUS=1 order by TIME_NAME";
DataTable dt = GetDatatable(sql, null);
if (dt.Rows.Count > 0)
{
DataRow dr = dt.NewRow();
dr["time_code"] = "";
dr["time_name"] = "";
dt.Rows.InsertAt(dr, 0);
ddl.ValueField = "time_code";
ddl.TextField = "time_name";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例12: SetDDL_PosType
public static void SetDDL_PosType(ASPxComboBox ddl)
{
try
{
string sql = "select LEVEL_GROUP_NAME,min(cur_lev) as cur_lev from PSST_PER_LEVEL where PER_TYPE='11' and LEVEL_GROUP_NAME is not null group by LEVEL_GROUP_NAME order by CUR_LEV";
DataTable dt = GetDatatable(sql, null);
if (dt.Rows.Count > 0)
{
ddl.ValueField = "LEVEL_GROUP_NAME";
ddl.TextField = "LEVEL_GROUP_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例13: SetDDL_PER_LEVEL_NAME
public static void SetDDL_PER_LEVEL_NAME(ASPxComboBox ddl, string group_name,string per_type)
{
try
{
string sql = "select CUR_LEV,LEVEL_GROUP_NAME,LEVEL_NAME from PSST_PER_LEVEL where 1=1 " + Environment.NewLine;
sql += " and PER_TYPE = '" + per_type + "'";
if (!string.IsNullOrEmpty(group_name))
{
sql += " and LEVEL_GROUP_NAME = '" + group_name + "'";
}
DataTable dt = GetDatatable(sql, null);
if (dt.Rows.Count > 0)
{
DataRow dr = dt.NewRow();
dr["LEVEL_NAME"] = "";
dt.Rows.InsertAt(dr, 0);
ddl.ValueField = "CUR_LEV";
ddl.TextField = "LEVEL_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例14: SetDDLRemark
public static void SetDDLRemark(ASPxComboBox ddl, bool IsAll = false)
{
//กำหนดค่าให้กับ Dropdownlist หมายเหตุการลงเวลา
try
{
//string sql = "select distinct remarks id,remarks from HRM_TIME_PROCESS where remarks is not null order by remarks ";
string sql = "select LEAVE_ID,LEAVE_NAME from PDM_MS_LEAVE where LEAVE_TYPE_ID = 2";
DataTable dt = GetDatatable(sql, null);
if (dt.Rows.Count > 0)
{
if (IsAll == true)
{
DataRow dr = dt.NewRow();
dr["LEAVE_ID"] = "0";
dr["LEAVE_NAME"] = "ทั้งหมด";
dt.Rows.InsertAt(dr, 0);
}
ddl.ValueField = "LEAVE_ID";
ddl.TextField = "LEAVE_NAME";
ddl.DataSource = dt;
ddl.DataBind();
}
}
catch (Exception ex)
{
}
}
示例15: SetDDLBudgetYear
public static void SetDDLBudgetYear(ASPxComboBox ddl)
{
try
{
DataTable dt = new DataTable();
dt.Columns.Add("budget_year_value");
dt.Columns.Add("budget_year_display");
int startYear = DateTime.Now.AddYears(-10).Year;
for (int i = startYear; i <= (DateTime.Now.Year + 1); i++)
{
DataRow dr = dt.NewRow();
dr["budget_year_value"] = (i + 543).ToString();
dr["budget_year_display"] = (i + 543).ToString();
dt.Rows.Add(dr);
}
if (dt.Rows.Count > 0)
{
ddl.ValueField = "budget_year_value";
ddl.TextField = "budget_year_display";
ddl.DataSource = dt;
ddl.DataBind();
ddl.Value = setBudgetYear(DateTime.Now);
}
}
catch (Exception ex)
{
}
}