本文整理汇总了C#中RadComboBoxItem类的典型用法代码示例。如果您正苦于以下问题:C# RadComboBoxItem类的具体用法?C# RadComboBoxItem怎么用?C# RadComboBoxItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RadComboBoxItem类属于命名空间,在下文中一共展示了RadComboBoxItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPreRender
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
Entities.Users.UserInfo userInfo = Entities.Users.UserController.GetCurrentUserInfo();
if (! Page.IsPostBack && userInfo != null && userInfo.UserID != Null.NullInteger)
{
//check view permissions - Yes?
var portalSettings = PortalController.GetCurrentPortalSettings();
var pageCulture = Thread.CurrentThread.CurrentCulture.Name;
if (string.IsNullOrEmpty(pageCulture))
{
pageCulture = PortalController.GetActivePortalLanguage(portalSettings.PortalId);
}
List<TabInfo> tabs = TabController.GetTabsBySortOrder(portalSettings.PortalId, pageCulture, true);
var sortedTabList = TabController.GetPortalTabs(tabs, Null.NullInteger, false, Null.NullString, true, false, true, true, true);
Items.Clear();
foreach (var _tab in sortedTabList)
{
RadComboBoxItem tabItem = new RadComboBoxItem(_tab.IndentedTabName, _tab.FullUrl);
tabItem.Enabled = ! _tab.DisableLink;
Items.Add(tabItem);
}
Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("", ""));
}
Width = Unit.Pixel(245);
}
示例2: Create
public void Create(string objname, string id,string name, string templatename)
{
_objname = objname;
_id = id;
_name = name;
DataReturn dr = AxiomIRISRibbon.Utility.HandleData(_d.GetTemplates(true));
if (!dr.success) return;
DataTable dt = dr.dt;
cbTemplates.Items.Clear();
RadComboBoxItem i;
RadComboBoxItem selected = null;
foreach (DataRow r in dt.Rows)
{
i = new RadComboBoxItem();
i.Tag = r["Id"].ToString() + "|" + r["PlaybookLink__c"].ToString();
i.Content = r["Name"].ToString();
this.cbTemplates.Items.Add(i);
if (r["Name"].ToString().ToLower() == templatename.Trim().ToLower()) selected = i;
}
// if we have a match then select it
if (selected != null)
{
this.cbTemplates.SelectedItem = selected;
}
}
示例3: LoadItemsInternal
protected virtual void LoadItemsInternal()
{
base.Items.Clear();
if (this.FirstItemEmpty)
base.Items.Add(XCombo.CreateEmptyItem());
using (IDataReader dr = this.CreateDataReader())
{
StringBuilder sb = new StringBuilder();
while (dr.Read())
{
int j = 1;
for (; j < dr.FieldCount - 1; ++j)
{
object value = dr[j];
if (value != DBNull.Value)
{
sb.Append(value);
sb.Append(" - ");
}
}
sb.Append(dr[j]);
RadComboBoxItem item = new RadComboBoxItem(sb.ToString(), dr[0].ToString());
base.Items.Add(item);
sb.Length = 0;
}
}
}
示例4: LoadGradeButtonFilter
protected void LoadGradeButtonFilter()
{
var gradesByCurriculumCourses = _curriculumCourseList.GetGradeList();
gradeDropdown.Items.Clear();
gradeDropdown.Attributes["teacherID"] = _teacherID.ToString();
foreach (var g in gradesByCurriculumCourses)
{
RadComboBoxItem item = new RadComboBoxItem();
item.Text = g.DisplayText;
item.Value = g.DisplayText;
item.Attributes["gradeOrdinal"] = g.GetFriendlyName();
if (g.DisplayText == grade)
{
item.Selected = true;
}
gradeDropdown.Items.Add(item);
}
initGrade.Value = gradeDropdown.SelectedIndex.ToString();
if (gradeDropdown.SelectedValue.Length == 0 && gradeDropdown.Items.Count == 1)
{
gradeDropdown.Items[0].Selected = true;
}
}
示例5: RadComboBoxFirma_ItemsRequested
protected void RadComboBoxFirma_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
{
if (e.Text.Length > 3)
{
string sqlSelectCommand = "";
sqlSelectCommand = "SELECT [UserID],[UserName] from [telerik_Users] ORDER BY [UserName]";
SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings["KalData"].ConnectionString);
adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
DataTable dataTable = new DataTable();
adapter.Fill(dataTable);
RadComboBoxFirma.Items.Clear();
foreach (DataRow dataRow in dataTable.Rows)
{
string UserName = "";
RadComboBoxItem item = new RadComboBoxItem();
item.Text = (string)dataRow["UserName"].ToString();
item.Value = dataRow["UserId"].ToString();
UserName = (string)dataRow["UserName"];
if (dataRow["UserName"] != System.DBNull.Value)
{
UserName = (string)dataRow["UserName"];
}
//item.Attributes.Add("FIRMAADI", FirmaAdi);
//item.Attributes.Add("IL_ILCE", IlIlce);
RadComboBoxFirma.Items.Add(item);
item.DataBind();
}
Label lbl = (Label)RadComboBoxFirma.Footer.FindControl("lblBulunanKayitSayisi");
lbl.Text = "Bulunan kayıt sayısı:" + " " + dataTable.Rows.Count.ToString();
}
}
示例6: LoadSchoolDropdown
private void LoadSchoolDropdown()
{
schoolDropdown.Items.Clear();
//Build school ListBox
foreach (var school in _schools)
{
var schoolListItem = new RadComboBoxItem
{
Text = school.Name,
Value = school.ID.ToString(CultureInfo.InvariantCulture)
};
schoolDropdown.Items.Add(schoolListItem);
var itemLabel = (Label)schoolListItem.FindControl("schoolLabel");
if (itemLabel != null)
{
itemLabel.Text = school.Name;
}
}
var findButton = new RadComboBoxItem();
schoolDropdown.Items.Add(findButton);
var findButtonCheckbox = (CheckBox)findButton.FindControl("schoolCheckbox");
if (findButtonCheckbox != null)
{
findButtonCheckbox.InputAttributes["style"] = "display:none;";
}
}
示例7: Page_Init
protected void Page_Init(object sender, EventArgs e)
{
string uname = Request.QueryString["uname"].ToString();
string getuid = "select [ID] from [User] where [uname] = '"+uname+"'";
DataSet ds = new DataSet();
ds = fbc.ReturnDS(getuid);
string uidd = ds.Tables[0].Rows[0]["ID"].ToString();
Session["VID"] = uidd;
string getalbums = "SELECT * FROM Albums WHERE UID = " +uidd;
DataTable dt = new DataTable();
dt = fbc.ReturnDT(getalbums);
albums.DataSource = dt;
albums.DataBind();
RadComboBoxItem item = new RadComboBoxItem();
item.Value = "propic";
item.Text = "Profile Photos";
albums.Items.Add(item);
RadComboBoxItem item2 = new RadComboBoxItem();
item2.Value = "select";
item2.Text = "Select Album";
albums.Items.Add(item2);
int d = albums.Items.Count;
albums.Items[d-1].Selected = true;
}
示例8: RadScheduler1_DataBound
protected void RadScheduler1_DataBound(object sender, EventArgs e)
{
RadScheduler1.ResourceTypes.FindByName("User").AllowMultipleValues = true;
IList<Resource> pagedResources = new List<Resource>(RadScheduler1.Resources.GetResourcesByType("User"));
IList<Resource> remainingResources = new List<Resource>();
IList<RadComboBoxItem> comboItems = new List<RadComboBoxItem>();
RadCombobox1.Items.Clear();
//int resourceIndex = 0;
string selectedLetter = Hiddenfield1.Value;
char[] sep = { ',' };
string[] newResources = selectedLetter.Split(sep, StringSplitOptions.RemoveEmptyEntries);
foreach (Resource resource in pagedResources)
{
bool isSelected = false;
for (int i = 0; i < newResources.Length; i++)
{
if (resource.Text != newResources[i])
{
isSelected = true;
}
else
{
isSelected = false;
break;
}
}
if (isSelected)
{
RadScheduler1.Resources.Remove(resource);
remainingResources.Add(resource);
RadCombobox1.Items.Add(new RadComboBoxItem(resource.Text));
}
else
{
RadComboBoxItem newItem = new RadComboBoxItem(resource.Text);
newItem.Checked = true;
RadCombobox1.Items.Add(newItem);
}
}
// Hiddenfield1.Value = "ready";
//}
//else
//{
// foreach (Resource resource in pagedResources)
// {
// RadCombobox1.Items.Add(new RadComboBoxItem(resource.Text));
// }
//}
Session["remainingResources"] = remainingResources;
}
示例9: FillDateFilterDDL
protected void FillDateFilterDDL()
{
DdlDate.Items.Add(new RadComboBoxItem("Today's data", "0"));
DdlDate.Items.Add(new RadComboBoxItem("Last seven days", "7"));
DdlDate.Items.Add(new RadComboBoxItem("Current month", "30"));
RadComboBoxItem rcbItem = new RadComboBoxItem("All", "-1");
rcbItem.Selected = true;
DdlDate.Items.Add(rcbItem);
DdlDate.Items.Add(new RadComboBoxItem("Custom date...", "-2"));
}
示例10: CarregueCombo
private void CarregueCombo()
{
foreach (EnumeradorFiltroPatente enumerador in EnumeradorFiltroPatente.ObtenhaTodos())
{
var item = new RadComboBoxItem(enumerador.Descricao, enumerador.Id.ToString());
item.Attributes.Add("Codigo", enumerador.Id.ToString());
cboFiltroPatente.Items.Add(item);
item.DataBind();
}
}
示例11: PromotionList
private void PromotionList()
{
ObjLogin cust = (ObjLogin)Session["objLogin"];
ddlPromotion.DataSource = ScheduleRepo.GetListPhonePromotion(cust.Phone,Constant.outbox);
ddlPromotion.DataTextField = "Title";
ddlPromotion.DataValueField = "Id";
ddlPromotion.DataBind();
RadComboBoxItem item = new RadComboBoxItem("Select all", "0");
ddlPromotion.Items.Insert(0, item);
}
示例12: ListRegion
private void ListRegion()
{
var region = (int.Parse(ddlGroup.SelectedValue) > 0) ? regionRepo.GetRegionByGroupId(int.Parse(ddlGroup.SelectedValue)) : regionRepo.GetAll();
ddlRegion.DataSource = region;
ddlRegion.DataTextField = "RegionName";
ddlRegion.DataValueField = "Id";
ddlRegion.DataBind();
RadComboBoxItem item = new RadComboBoxItem("Select a region", "0");
ddlRegion.Items.Insert(0, item);
}
示例13: ListGroup
private void ListGroup()
{
var group = groupRepo.GetAll();
ddlGroup.DataSource = group;
ddlGroup.DataTextField = "GroupName";
ddlGroup.DataValueField = "Id";
ddlGroup.DataBind();
RadComboBoxItem item = new RadComboBoxItem("Select a group", "0");
ddlGroup.Items.Insert(0, item);
}
示例14: ListCustomerType
/// <summary>
/// Load data to comboboxes when page_load
/// </summary>
private void ListCustomerType()
{
var customertype = CTypeRepo.GetAll();
ddlCustomerType.DataSource = customertype;
ddlCustomerType.DataTextField = "TypeName";
ddlCustomerType.DataValueField = "Id";
ddlCustomerType.DataBind();
RadComboBoxItem item=new RadComboBoxItem("Select a type","0");
ddlCustomerType.Items.Insert(0, item);
}
示例15: ListChannel
private void ListChannel()
{
var channelList = ChannelRepo.GetAll();
ddlChannel.DataSource = channelList;
ddlChannel.DataValueField = "Id";
ddlChannel.DataTextField = "ChannelName";
ddlChannel.DataBind();
RadComboBoxItem item = new RadComboBoxItem("Select a channel", "0");
ddlChannel.Items.Insert(0, item);
}