本文整理汇总了C#中ASPxComboBox类的典型用法代码示例。如果您正苦于以下问题:C# ASPxComboBox类的具体用法?C# ASPxComboBox怎么用?C# ASPxComboBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ASPxComboBox类属于命名空间,在下文中一共展示了ASPxComboBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SeleccionarItemCombo
public static void SeleccionarItemCombo(ref ASPxComboBox combo, string valor, string texto)
{
combo.SelectedIndex = -1;
if ((combo.Items.FindByValue(valor) == null))
combo.Items.Insert(0, new ListEditItem(texto, valor));
combo.Items.FindByValue(valor).Selected = true;
}
示例2: 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)
{
}
}
示例3: addButton4Cmb
public static void addButton4Cmb(System.Web.UI.Page mypage, ASPxComboBox cmb, int Buttontype, string popupID)
{
string prefixCookie = mypage.GetType().ToString().Replace("ASP.", "");
switch (Buttontype)
{
case 0://add cả 2 button
AddFavButton4Cmb(cmb);
AddNewButton4Cmb(cmb);
cmb.ClientSideEvents.Init = "function(s,e){ GetDefaultValue4Cmb(s,'" + prefixCookie + "_" + cmb.ClientInstanceName + "'); }";
cmb.ClientSideEvents.ButtonClick = "function(s,e){ if( e.buttonIndex == 0){setCookie('" + prefixCookie + "_" + cmb.ClientInstanceName + "',s.GetValue(),365);} else { popupWindow4Cmb('" + popupID + "');} }";
break;
case 1://chi add button new
AddNewButton4Cmb(cmb);
cmb.ClientSideEvents.ButtonClick = "function(s,e){ popupWindow4Cmb('" + popupID + "'); }";
break;
case 2://chỉ add button fav
AddNewButton4Cmb(cmb);
cmb.ClientSideEvents.Init = "function(s,e){ GetDefaultValue4Cmb(s,'" + prefixCookie + "_" + cmb.ClientInstanceName + "'); }";
cmb.ClientSideEvents.ButtonClick = "function(s,e){ setCookie('" + prefixCookie + "_" + cmb.ClientInstanceName + "',s.GetValue(),365); }";
break;
}
/*
* <ButtonStyle BackColor="Transparent">
<Paddings Padding="0px" />
<Border BorderStyle="None" />
</ButtonStyle>
*/
cmb.ClientSideEvents.GotFocus = "function(s,e){ s.SelectAll(); }";
//cmb.ButtonStyle.BackColor = Color.Transparent;
//cmb.ButtonStyle.Width = Unit.Pixel(15);
//cmb.ButtonStyle.Paddings.Padding = Unit.Pixel(0);
//cmb.ButtonStyle.Border.BorderStyle = BorderStyle.None;
//cmb.SkinID = "cmbDefault";
}
示例4: 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)
{
}
}
示例5: AddFavButton4Cmb
public static void AddFavButton4Cmb(ASPxComboBox cmb)
{
var btnFav = new EditButton { Position = ButtonsPosition.Left };
btnFav.Image.Url = "~/img/btnico/star.png";
btnFav.Image.Width = Unit.Pixel(16);
btnFav.ToolTip = "Nhấn vào đây để chọn mục này là mặc định cho lần sau.";
cmb.Buttons.Add(btnFav);
}
示例6: 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
}
示例7: AddNewButton4Cmb
/*
<dx:EditButton Position="Left" ToolTip="<%$ Resources:Control, DefaultButton.Tooltip %>">
<Image Height="16px" Url="~/img/btnico/star.png" Width="16px">
</Image>
</dx:EditButton>
<dx:EditButton ToolTip="<%$ Resources:Control, AddButton.Tooltip %>">
<Image Url="~/img/common/Add.png" Width="16px">
</Image>
</dx:EditButton>
*/
public static void AddNewButton4Cmb(ASPxComboBox cmb)
{
var btnNew = new EditButton { Position = ButtonsPosition.Right };
btnNew.Image.Url = "~/img/common/Add.png";
btnNew.Image.Width = Unit.Pixel(16);
btnNew.ToolTip = "Nhấn vào đây để tạo mới thêm danh mục này";
cmb.Buttons.Add(btnNew);
}
示例8: buildcmbButton
/// <summary>
/// Tao nut add/fav/refresh
/// </summary>
/// <param name="cmb">Truyen vao control combobox</param>
/// <param name="type">Truyen vao loai nut. 0 : Fav; 1:Fav+Add;2:Fav+Add+Refresh;3:Only Refresh;4:Only Add;5: Fav+Refresh</param>
public void buildcmbButton(ASPxComboBox cmb, int type, string popupCode = "")
{
int modulePage = -1;
try
{
Int32.TryParse(CU.getCurrentModuleID().ToString(), out modulePage);
}
catch (System.NullReferenceException) { }
int width = 500;
int height = 500;
string title = "Error load Page!!!";
string param = "";
DataTable dtPopupWindow = new DataTable();
dtPopupWindow = SY_GetModuleID_for_PopUpcontrol(popupCode);
if (dtPopupWindow.Rows.Count > 0)
{
SiAuto.Main.LogDataTable(dtPopupWindow);
moduleID = int.Parse(dtPopupWindow.Rows[0]["moduleID"].ToString());
width = int.Parse(dtPopupWindow.Rows[0]["width"].ToString());
height = int.Parse(dtPopupWindow.Rows[0]["height"].ToString());
title = dtPopupWindow.Rows[0]["title"].ToString();
param = dtPopupWindow.Rows[0]["paramArray"].ToString();
}
else
return;
SiAuto.Main.LogInt("ModulePage=", modulePage);
SiAuto.Main.LogInt("ModuleID=", moduleID);
switch (type)
{
case 0:
buildFavBtn(cmb, modulePage);
break;
case 1:
if (checkPermissionBtn(moduleID))
buildFavAddBtn(cmb, popupCode, modulePage, moduleID, width, height, title, param);
else buildFavBtn(cmb, modulePage);
break;
case 2:
if (checkPermissionBtn(moduleID))
buildAllBtn(cmb, popupCode, modulePage, moduleID, width, height, title, param);
else buildFavRefresh(cmb, modulePage);
break;
case 3:
buildRefreshBtn(cmb);
break;
case 4:
if (checkPermissionBtn(moduleID))
buildAddBtn(cmb, popupCode, moduleID, width, height, title, param);
break;
case 5:
buildFavRefresh(cmb, modulePage);
break;
default:
break;
}
}
示例9: InitDurationCombo
static void InitDurationCombo(ASPxComboBox cbSnooze) {
cbSnooze.Items.Clear();
TimeSpan[] snoozeTimeSpans = GetTimeSpans();
int length = snoozeTimeSpans.Length;
for (int i = 0; i < length; i++) {
TimeSpan span = snoozeTimeSpans[i];
cbSnooze.Items.Add(new ListEditItem(ConvertTimeSpanToString(span), span));
}
cbSnooze.SelectedIndex = 4;
}
示例10: RenderControl
public List<WebControl> RenderControl(XmlNode xmlControl)
{
base.Initialize(xmlControl);
ASPxComboBox aspxListBox = new ASPxComboBox
{
ID = _PropertyMapper.GetID(),
ClientInstanceName = _PropertyMapper.GetID()
};
if (string.IsNullOrEmpty(_PropertyMapper.GetDefault()))
aspxListBox.SelectedIndex = 0;
aspxListBox.Callback += new DevExpress.Web.ASPxClasses.CallbackEventHandlerBase(aspxListBox_Callback);
XmlNode valuesNode = _PropertyMapper.GetValuesNode();
// Carga los datos de la lista
foreach (XmlNode xmlValueNode in valuesNode.ChildNodes)
{
ListEditItem listEditItem = new ListEditItem();
listEditItem.Value = xmlValueNode.GetAttribute("CCLAVE");
listEditItem.Text = xmlValueNode.GetAttribute("CTEXTO");
listEditItem.Selected = (_PropertyMapper.GetDefault() == xmlValueNode.GetAttribute("CCLAVE")) ? true : false;
aspxListBox.Items.Add(listEditItem);
}
try
{
if (xmlControl.GetAttribute("CCONTROLASOC") != null)
{
aspxListBox.ClientSideEvents.ValueChanged = "function(s, e) {" + xmlControl.GetAttribute("CCONTROLASOC") + ".PerformCallback(" + _PropertyMapper.GetID() + ".GetValue());}";
aspxListBox.ClientSideEvents.Init = "function(s, e) {" + xmlControl.GetAttribute("CCONTROLASOC") + ".PerformCallback(" + _PropertyMapper.GetID() + ".GetValue());}";
}
}
catch (Exception)
{
}
_Controls.Add(aspxListBox);
return _Controls;
}
示例11: FillEditor
void FillEditor(ASPxComboBox editor) {
if (editor == null) return;
editor.Items.Clear();
editor.ValueType = GetComboBoxValueType();
IEnumerable dataSource = GetDataSource();
if (_propertyType.IsGenericType && _propertyType.GetGenericTypeDefinition() == typeof(Nullable<>)) {
editor.Items.Add(CaptionHelper.NullValueText, null);
}
if (dataSource != null)
foreach (object value in dataSource) {
if (value is ListEditItem)
editor.Items.Add(value as ListEditItem);
else
editor.Items.Add(CreateEditItem(value));
}
}
示例12: 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;
}
}
示例13: 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)
{
}
}
示例14: SetDDLORG
public static void SetDDLORG(ASPxComboBox ddl)
{
try
{
string sql = "SELECT '' ORG_SERIAL,'เลือกหน่วยงาน' ORG_NAME,'' ORG_ABBR UNION ALL SELECT CONVERT(varchar,ORG_SERIAL) ORG_SERIAL,ORG_NAME,ORG_ABBR FROM vw_SMM_ORG";
SqlDataAdapter da = new SqlDataAdapter(sql, StaticDefaultConnectionString);
DataTable dt = new DataTable();
da.Fill(dt);
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)
{
}
}
示例15: 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)
{
}
}