本文整理汇总了C#中System.Web.UI.WebControls.ListItemCollection类的典型用法代码示例。如果您正苦于以下问题:C# ListItemCollection类的具体用法?C# ListItemCollection怎么用?C# ListItemCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListItemCollection类属于System.Web.UI.WebControls命名空间,在下文中一共展示了ListItemCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataSet ds = objTransferPackageTimings.GetAllTrasferpackageDescription(int.Parse(Request.QueryString["ID"].ToString()));
GridView1.DataSource = ds;
GridView1.DataBind();
foreach (GridViewRow item in GridView1.Rows)
{
Label lblfromTOid = (Label)item.FindControl("lbltp_detialid");
Label lblFlag = (Label)item.FindControl("lblFlag");
DDL1 = (MulticheckDropdown)item.FindControl("DDL1");
DataSet ds1 = objTransferPackageTimings.GetAallTimings();
//DataSet DsMealDate = objHotelStoreProcedure.getALLdateFORmEAL(txtpty_CheckIn.Text, txtpty_CheckOut.Text);
ListItemCollection list = new ListItemCollection();
for (int i1 = 0; i1 < ds1.Tables[0].Rows.Count; i1++)
{
ListItem listitem = new ListItem(Convert.ToString(ds1.Tables[0].Rows[i1]["TIME"]), Convert.ToString(ds1.Tables[0].Rows[i1]["TIME"]));
list.Add(listitem);
}
DDC1.DDList.DataSource = list;
DDC1.DDList.DataTextField = "Text";
DDC1.DDList.DataValueField = "Value";
DDC1.DDList.DataBind();
DataSet ds11 = objTransferPackageTimings.GetAllTrasferpackageTimmings(int.Parse(lblfromTOid.Text), lblFlag.Text, "SIC");
if (ds11.Tables[0].Rows.Count != 0)
{
ListItemCollection list2 = new ListItemCollection();
for (int j = 0; j < ds11.Tables[0].Rows.Count; j++)
{
for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
{
if (ds1.Tables[0].Rows[i]["TIME"].ToString() == ds11.Tables[0].Rows[j]["AutoSearchResult"].ToString())
{
setchk = setchk + "," + Convert.ToString(ds11.Tables[0].Rows[j]["AutoSearchResult"].ToString());
}
}
}
setchk = setchk.Substring(1);
DDC1.SetCheckBoxValues(setchk);
setchk = "";
}
}
}
}
开发者ID:pareshf,项目名称:testthailand,代码行数:60,代码来源:TransferPackageTimingMaster.aspx.cs
示例2: RenderBulletText
// Writes the text of each bullet according to the list's display mode.
protected virtual void RenderBulletText (ListItemCollection items, int index, HtmlTextWriter writer) {
switch (Control.DisplayMode) {
case BulletedListDisplayMode.Text:
writer.WriteEncodedText(items[index].Text);
writer.WriteBreak();
break;
case BulletedListDisplayMode.HyperLink:
//
string targetURL = Control.ResolveClientUrl(items[index].Value);
if (items[index].Enabled) {
PageAdapter.RenderBeginHyperlink(writer, targetURL, true /* encode */, items[index].Text);
writer.Write(items[index].Text);
PageAdapter.RenderEndHyperlink(writer);
} else {
writer.WriteEncodedText(items[index].Text);
}
writer.WriteBreak();
break;
case BulletedListDisplayMode.LinkButton:
if (items[index].Enabled) {
//
PageAdapter.RenderPostBackEvent(writer, Control.UniqueID, index.ToString(CultureInfo.InvariantCulture),
items[index].Text, items[index].Text);
} else {
writer.WriteEncodedText(items[index].Text);
}
writer.WriteBreak();
break;
default:
Debug.Assert(false, "Invalid BulletedListDisplayMode");
break;
}
}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:34,代码来源:WmlBulletedListAdapter.cs
示例3: AddTradeItems
protected void AddTradeItems(int TradeId, int TeamId, ListItemCollection List)
{
foreach (ListItem i in List)
{
if (i.Selected)
{
int Id = int.Parse(i.Value.Substring(1));
int PlayerId = -1;
int PickId = -1;
if (i.Value.ToCharArray()[0] == 'd')
{
PickId = Id;
}
else
{
PlayerId = Id;
}
int DontCare = (int)SqlHelper.ExecuteScalar(
System.Configuration.ConfigurationManager.AppSettings["ConnectionString"],
"spAddTradeItem",
TradeId,
TeamId,
PickId,
PlayerId
);
}
}
}
开发者ID:ohri,项目名称:netba,代码行数:29,代码来源:TradePropose.aspx.cs
示例4: BindLotteryMaintenanceNavigation
private void BindLotteryMaintenanceNavigation()
{
//notes: set up collection of list items
ListItemCollection navigationList = new ListItemCollection();
//notes: set local variables and set default values
bool isLotteryLookupLinkable = true;
string lotteryLookupQueryString = string.Empty;
switch (this.CurrentNavigationLink)
{
case LotteryMaintenanceNavigation.LotteryLookup:
isLotteryLookupLinkable = false;
break;
}
//notes: add each item to the collection
navigationList.Add(new ListItem { Text = "Lottery Game Lookup", Value = "/LotteryMaintenance/Default/aspx", Enabled = isLotteryLookupLinkable });
//notes: bind list object to front-end control
LotteryMaintenanceNavigationList.DataSource = navigationList;
LotteryMaintenanceNavigationList.DataBind();
}
开发者ID:bllr777,项目名称:CheckWork,代码行数:25,代码来源:LotteryMaintenanceNavigationControl.ascx.cs
示例5: SelectSingleListItem
public static void SelectSingleListItem(ListItemCollection items, string val)
{
foreach(ListItem itm in items)
if(itm.Value == val)
itm.Selected = true;
else itm.Selected = false;
}
开发者ID:jmptrader,项目名称:docflow-aspnet,代码行数:7,代码来源:WebUtils.cs
示例6: BuildListFromEnum
public static ListItemCollection BuildListFromEnum(Enum objEnum)
{
ListItemCollection colListItems = new ListItemCollection();
ListItem liItem;
SortedList colSortedListItems = new SortedList();
foreach (int value in Enum.GetValues(objEnum.GetType()))
{
liItem = new ListItem();
liItem.Value = value.ToString();
liItem.Text = StringEnum.GetStringValue((Enum)Enum.Parse(objEnum.GetType(), value.ToString(), true));
if (liItem.Text != string.Empty)
{
colSortedListItems.Add(liItem.Text, liItem);
}
liItem = null;
}
foreach (ListItem liListItem in colSortedListItems.GetValueList())
{
colListItems.Add(liListItem);
}
return colListItems;
}
开发者ID:IntertechInc,项目名称:.net-utilities,代码行数:28,代码来源:ListItemHelper.cs
示例7: ExtendedListItemCollection
/// <summary>
/// Initializes a new instance of the <see cref="ExtendedListItemCollection"/> class.
/// </summary>
/// <param name="wrappedCollection">The wrapped collection.</param>
public ExtendedListItemCollection(ListItemCollection wrappedCollection)
{
if (null == wrappedCollection)
{
throw new ArgumentNullException("wrappedCollection");
}
this._wrappedCollection = wrappedCollection;
}
开发者ID:fmendes,项目名称:RegisterJavascript,代码行数:12,代码来源:ExtendedListItemCollection.cs
示例8: BindListItem
public static void BindListItem(ListItemCollection LIC, DataView DataSource, string TextField, string ValueField)
{
LIC.Clear();
for (int i = 0; i < DataSource.Count; i++)
{
LIC.Add(new ListItem(DataSource[i][TextField].ToString(), DataSource[i][ValueField].ToString()));
}
}
开发者ID:kingofhawks,项目名称:kcsj,代码行数:8,代码来源:CommonFunc.cs
示例9: AtribucionesUsuario
public AtribucionesUsuario(string usuario,string TipoUsuario,string UserId)
{
this.usuario = usuario;
this.tipoUsuario = TipoUsuario;
this.userId = UserId;
propiedades = new ListItemCollection();
}
开发者ID:royriojas,项目名称:RGEN2,代码行数:8,代码来源:AtribucionesUsuario.cs
示例10: BindingPages
private void BindingPages()
{
var pages = db.Pages.Where(t => t.ParentId == -1).ToList();
ListItemCollection list = new ListItemCollection();
GetListPages(pages, ref list, 0);
ddlPages.DataSource = list;
ddlPages.DataTextField = "Text";
ddlPages.DataValueField = "Value";
ddlPages.DataBind();
ddlPages.Items.Insert(0, new ListItem("-None-", "-1"));
}
开发者ID:valendo,项目名称:MyCMS,代码行数:11,代码来源:Setting.aspx.cs
示例11: DataBindSearchTermTagList
//绑定学期标识下拉列表
public void DataBindSearchTermTagList(ListItemCollection itemCollection)
{
DalOperationAboutCourses doac = new DalOperationAboutCourses();
DataTable dt = doac.FindAllTermTags().Tables[0];
string termTag = null;
for (int i = 0; i < dt.Rows.Count; i++)
{
termTag = dt.Rows[i]["termTag"].ToString().Trim();
ListItem li = new ListItem(CommonUtility.ChangeTermToString(termTag), termTag);
itemCollection.Add(li);
}
}
开发者ID:skyaspnet,项目名称:usta,代码行数:13,代码来源:AddTeacherSalary.aspx.cs
示例12: GetFontFamilies
public static ListItemCollection GetFontFamilies()
{
var col = new ListItemCollection
{
new ListItem("Arial", "Arial"),
new ListItem("Verdana", "Verdana"),
new ListItem("Lucida Sans", "Lucida Sans"),
new ListItem("Calibri", "Calibri"),
new ListItem("Trebuchet MS", "Trebuchet MS")
};
return col;
}
开发者ID:Learion,项目名称:BruceToolSet,代码行数:12,代码来源:FontsSettingsODS.cs
示例13: BindLotteryNavigation
private void BindLotteryNavigation()
{
ListItemCollection navigationList = new ListItemCollection();
bool isBasicInfo = true;
bool isDrawing = true;
bool isWinningNumber = true;
bool isState = true;
bool isWin = true;
string lotteryIdQueryString = "LotteryId=" + this.LotteryGameId.ToString();
if (this.LotteryGameId > 0)
{
switch (this.CurrentNavigationLink)
{
case LotteryNavigation.LotteryBasic:
isBasicInfo = false;
break;
case LotteryNavigation.Drawing:
isDrawing = false;
break;
case LotteryNavigation.WinningNumber:
isWinningNumber = false;
break;
case LotteryNavigation.State:
isState = false;
break;
case LotteryNavigation.Win:
isWin = false;
break;
}
}
else
{
isBasicInfo = false;
isDrawing = false;
isWinningNumber = false;
isState = false;
isWin = false;
}
navigationList.Add(new ListItem { Text = "Basic Info", Value ="/LotterySection/LotteryBasic.aspx?" + lotteryIdQueryString, Enabled = isBasicInfo });
navigationList.Add(new ListItem { Text = "Drawing", Value = "/LotterySection/Drawing.aspx?" + lotteryIdQueryString, Enabled = isDrawing });
navigationList.Add(new ListItem { Text = "Winning Numbers", Value = "/LotterySection/WinningNumber.aspx?" + lotteryIdQueryString, Enabled = isWinningNumber });
navigationList.Add(new ListItem { Text = "State", Value = "/LotterySection/State.aspx?" + lotteryIdQueryString, Enabled = isState });
navigationList.Add(new ListItem { Text = "Win", Value = "/LotterySection/Win.aspx?" + lotteryIdQueryString, Enabled = isWin });
LotteryNavigationList.DataSource = navigationList;
LotteryNavigationList.DataBind();
}
开发者ID:bllr777,项目名称:CheckWork,代码行数:52,代码来源:LotteryNavigationControl.ascx.cs
示例14: LoadStatus2DDL
protected void LoadStatus2DDL()
{
//Load list item to dropdownlist
ListItemCollection lstColl = new ListItemCollection();
lstColl.Add(new ListItem("Active", "1"));
lstColl.Add(new ListItem("InActive", "0"));
ddlStatus.DataSource = lstColl;
ddlStatus.DataTextField = "Text";
ddlStatus.DataValueField = "Value";
ddlStatus.DataBind();
ddlStatus.AutoPostBack = true;
}
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:13,代码来源:admin_media_types.ascx.cs
示例15: SelectListBoxItems
private void SelectListBoxItems(ListItemCollection listItems, string req)
{
if(req == null || req.Length == 0)
return;
string items_string = "," + req + ",";
foreach(ListItem itm in listItems)
{
if(items_string.IndexOf("," + itm.Value + ",") != -1)
itm.Selected = true;
else itm.Selected = false;
}
}
开发者ID:jmptrader,项目名称:docflow-aspnet,代码行数:13,代码来源:SearchForm.aspx.cs
示例16: LoadStatusList2DDL
public void LoadStatusList2DDL(string selected_value)
{
ListItemCollection lstColl = new ListItemCollection();
lstColl.Add(new ListItem("Active", "1"));
lstColl.Add(new ListItem("InActive", "0"));
rdlDiscontinued.DataSource = lstColl;
rdlDiscontinued.DataTextField = "Text";
rdlDiscontinued.DataValueField = "Value";
rdlDiscontinued.DataBind();
rdlDiscontinued.SelectedValue = selected_value;
}
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:13,代码来源:admin_banner_position_edit.aspx.cs
示例17: PopulateIsSecureList2DDL
public void PopulateIsSecureList2DDL()
{
ListItemCollection lstColl = new ListItemCollection();
lstColl.Add(new ListItem("Admin Menu", "True"));
lstColl.Add(new ListItem("Front Menu", "False"));
ddlIsSecure.DataSource = lstColl;
ddlIsSecure.DataTextField = "Text";
ddlIsSecure.DataValueField = "Value";
ddlIsSecure.DataBind();
ddlIsSecure.SelectedIndex = 0; // Select the first item
ddlIsSecure.AutoPostBack = true;
}
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:13,代码来源:admin_tabs.ascx.cs
示例18: CreateListCollectionOfNumbers
public static ListItemCollection CreateListCollectionOfNumbers(int Low, int High)
{
ListItemCollection colNumbersList = new ListItemCollection();
for (int i = Low; i <= High; i++)
{
string strNumber = i.ToString();
ListItem objNumberItem = new ListItem(strNumber, strNumber);
colNumbersList.Add(objNumberItem);
}
return colNumbersList;
}
开发者ID:IntertechInc,项目名称:.net-utilities,代码行数:13,代码来源:ListItemHelper.cs
示例19: FillToListBox
public static void FillToListBox(ListItemCollection lstItems, DataTable source, int rootId, bool superUser)
{
DataRow[] drCommands = source.Select("CommandParentID = " + rootId);
foreach(DataRow row in drCommands)
{
if (!superUser && (bool)row["IsSuperUser"]) continue;
ListItem rootItem = new ListItem(row["CommandName"].ToString(), row["CommandID"].ToString());
rootItem.Attributes.Add("Level","0");
lstItems.Add(rootItem);
LoadForCurListItem(lstItems, rootItem, source, superUser);
}
lstItems.Insert(0, new ListItem("Root","0"));
}
开发者ID:hoangtung56pm,项目名称:KPINew,代码行数:13,代码来源:CommandController.cs
示例20: LoadControlTypeList2DDL
protected void LoadControlTypeList2DDL()
{
ListItemCollection lstColl = new ListItemCollection();
lstColl.Add(new ListItem("Tab", "1"));
lstColl.Add(new ListItem("Module", "2"));
ddlControlType.DataSource = lstColl;
ddlControlType.DataTextField = "Text";
ddlControlType.DataValueField = "Value";
ddlControlType.DataBind();
ddlControlType.Items.Insert(0, new ListItem("- Chọn -", "0"));
ddlControlType.SelectedIndex = 0;
}
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:13,代码来源:admin_module_controller_add.aspx.cs
注:本文中的System.Web.UI.WebControls.ListItemCollection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论