本文整理汇总了C#中System.Web.UI.WebControls.ListViewItemEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ListViewItemEventArgs类的具体用法?C# ListViewItemEventArgs怎么用?C# ListViewItemEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListViewItemEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了ListViewItemEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClubListUK_OnItemDataBound
protected void ClubListUK_OnItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
ListViewDataItem dataItem = (ListViewDataItem)e.Item;
var club = dataItem.DataItem as ClubItem;
var lnkClub = e.Item.FindControl("lnkClub") as System.Web.UI.WebControls.Literal;
string ClubLinkUrl = "http://www.virginactive.co.uk/clubs/" + club.Name;
if (lnkClub != null)
{
if (club.IsFirst)
{
lnkClub.Text = @"<a href=""" + ClubLinkUrl + @""" class=""external club uk first"">" + club.Clubname.Rendered + @"</a>";
}
else
{
lnkClub.Text = @"<a href=""" + ClubLinkUrl + @""" class=""external club uk"">" + club.Clubname.Rendered + @"</a>";
}
}
}
}
示例2: lbAlbums_ItemDataBound
protected void lbAlbums_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
Folder data = ((ListViewDataItem)e.Item).DataItem as Folder;
HyperLink lnkImage = e.Item.FindControl("lnkImage") as HyperLink;
lnkImage.NavigateUrl = "~/Photos/ViewAlbum.aspx?AlbumID=" + data.FolderID;
Image image = e.Item.FindControl("Image") as Image;
image.ImageUrl = "~/Files/Photos/" + data.FullPathToCoverImage;
image.AlternateText = data.Name;
HyperLink lnkEdit = e.Item.FindControl("lnkEdit") as HyperLink;
lnkEdit.NavigateUrl = "~/Photos/EditAlbum.aspx?AlbumID=" + data.FolderID;
LinkButton linkDeleteAlbum = e.Item.FindControl("linkDeleteAlbum") as LinkButton;
linkDeleteAlbum.Attributes.Add("OnClick", "javascript:return(confirm('Bạn có chắc chắn muốn xóa album này?'));");
linkDeleteAlbum.Attributes.Add("FolderID", data.FolderID.ToString());
HyperLink lnkView = e.Item.FindControl("lnkView") as HyperLink;
lnkView.NavigateUrl = "~/Photos/ViewAlbum.aspx?AlbumID=" + data.FolderID;
lnkView.Text = data.Name;
}
}
示例3: DL_newslist_ItemDatabound
protected void DL_newslist_ItemDatabound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
ListViewDataItem ditem = (ListViewDataItem)e.Item;
//data reader
System.Data.DataRowView item = (System.Data.DataRowView)ditem.DataItem;
HyperLink NewsTitle = (HyperLink)ditem.FindControl("NewsTitle");
Literal NewsDate = (Literal)ditem.FindControl("NewsDate");
XmlDocument XMLDoc = new XmlDocument();
XMLDoc.LoadXml(item["content_html"].ToString());
string HeadLine = commonfunctions.getFieldValue(XMLDoc, "Headline", "/News");
string Date = commonfunctions.getFieldValue(XMLDoc, "Date", "/News");
string Teaser = commonfunctions.getFieldValue(XMLDoc, "Teaser", "/News");
DateTime DateShown = Convert.ToDateTime(Date);
long newsId = long.Parse(item["content_id"].ToString());
NewsDate.Text = DateShown.ToString("MMMM dd, yyyy");
NewsTitle.Text = HeadLine;
NewsTitle.NavigateUrl = commonfunctions.getQuickLink(newsId); ;
}
}
示例4: lvAlbum_ItemDataBound
protected void lvAlbum_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
File data = ((ListViewDataItem)e.Item).DataItem as File;
HyperLink lnkView = e.Item.FindControl("lnkView") as HyperLink;
HyperLink lnkImage = e.Item.FindControl("lnkImage") as HyperLink;
string pathToImage = "~/files/photos/" + lnkImage.NavigateUrl + "/" + data.FileSystemName;
lnkImage.NavigateUrl = "~/Photos/ViewView.aspx?FileID=" + data.FileID;
lnkView.NavigateUrl = "~/Photos/ViewView.aspx?FileID=" + data.FileID;
string name = data.FileName;
if (name.Length > 25)
name = name.Substring(0, 25);
lnkView.Text = System.IO.Path.GetFileNameWithoutExtension(name);
lnkView.NavigateUrl = "~/Photos/ViewView.aspx?FileID=" + data.FileID;
Image image = e.Item.FindControl("Image") as Image;
image.ImageUrl = pathToImage + "__s." + data.Extension;
image.AlternateText = data.FileName;
}
else if (e.Item.ItemType == ListViewItemType.EmptyItem)
{
HyperLink linkAddPhotos = e.Item.FindControl("linkAddPhotos") as HyperLink;
linkAddPhotos.NavigateUrl = "~/photos/AddPhotos.aspx?AlbumID=" + _webContext.AlbumID.ToString();
}
}
示例5: ListViewRepairSheet_ItemDataBound
protected void ListViewRepairSheet_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
ListViewDataItem DataItem = (ListViewDataItem)e.Item;
DataRowView dv = (DataRowView)DataItem.DataItem;
AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow repairsheetRow = (AfterSaleServiceSystem.DAL.dsRepairSheet.tb_repairsheetRow)dv.Row;
tb_repairstateTableAdapter repairstateTableAdapter = new tb_repairstateTableAdapter();
if (repairstateTableAdapter.GetDatabyid(repairsheetRow.repairstateid).Rows.Count > 0)
{
AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow repairstateRow =
(AfterSaleServiceSystem.DAL.dsRepairState.tb_repairstateRow)
repairstateTableAdapter.GetDatabyid(repairsheetRow.repairstateid).Rows[0];
Label lb = (Label)e.Item.FindControl("repairstateidLabel");
if (lb != null)
lb.Text = repairstateRow.description;
}
tb_customTableAdapter customTableAdapter = new tb_customTableAdapter();
if (customTableAdapter.GetDataByid(repairsheetRow.customid).Rows.Count > 0)
{
AfterSaleServiceSystem.DAL.dsCustomer.tb_customRow customRow =
(AfterSaleServiceSystem.DAL.dsCustomer.tb_customRow)
customTableAdapter.GetDataByid(repairsheetRow.customid).Rows[0];
Label lb = (Label)e.Item.FindControl("customidLabel");
if (lb != null)
lb.Text = customRow.company;
}
}
}
示例6: BindSelectedPermission
public void BindSelectedPermission(object sender, ListViewItemEventArgs e)
{
KeyValuePair<string, ModelPermissionLevel> item = (KeyValuePair<string, ModelPermissionLevel>)e.Item.DataItem;
string grpName = item.Key;
ModelPermissionLevel lvl = item.Value;
// To the user, these are equivalent in terms of access
if (lvl == ModelPermissionLevel.NotSet)
lvl = _permissionsManager.CheckGroupPermissions(_permissionsManager.GetUserGroup(DefaultGroups.AllUsers), _pid);
var row = e.Item.FindControl("DataRow");
if (grpName == DefaultGroups.AllUsers)
((System.Web.UI.HtmlControls.HtmlTableCell)row.Controls[0]).InnerText = PermissionsManager.ALL_USERS_LABEL;
else if (grpName == DefaultGroups.AnonymousUsers)
((System.Web.UI.HtmlControls.HtmlTableCell)row.Controls[0]).InnerText = PermissionsManager.ANONYMOUS_USERS_LABEL;
if (e.Item.ItemType == ListViewItemType.DataItem)
{
DropDownList dd = (DropDownList)row.FindControl("DropdownColumn")
.FindControl("PermissionsDropdownList");
foreach(ListItem li in dd.Items)
{
if (Int32.Parse(li.Value) == (int)lvl)
{
li.Selected = true;
break;
}
}
}
}
示例7: lstProperty_itemDataBound
protected void lstProperty_itemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
PropertyTableAzure property = (PropertyTableAzure)e.Item.DataItem;
HtmlImage link = (HtmlImage)e.Item.FindControl("imgProperty");
HtmlAnchor html = (HtmlAnchor)e.Item.FindControl("hyparchor");
Label price = (Label)e.Item.FindControl("lblPrice");
Label street = (Label)e.Item.FindControl("lblStreet");
Label suburb = (Label)e.Item.FindControl("lblSuburb");
Label city = (Label)e.Item.FindControl("lblCity");
if (property.ImageUrlAzures.Any())
{
html.HRef = Settings.Default.PropertyUrlSA + "Public/PropertyDetails.aspx?PropertyID=" + property.PropertyID;
link.Src = property.ImageUrlAzures[0].thumbnailblob;
//link.Target = "_blank";
//link.NavigateUrl = Settings.Default.PropertyUrlKA + "Public/PropertyDetails.aspx?PropertyID=" + property.PropertyID;
}
price.Text = property.Price;
street.Text = property.StreetName;
suburb.Text = property.Suburb;
city.Text = property.City;
}
}
示例8: lvFeedbacks_ItemCreated
protected void lvFeedbacks_ItemCreated(object sender, ListViewItemEventArgs e)
{
ImageButton lb = e.Item.FindControl("ibDelete") as ImageButton;
lb.Visible = this.IsEditMode;
Label l = e.Item.FindControl("lblFeedbackWriterEmail") as Label;
l.Visible = this.IsEditMode;
}
示例9: lvLinks_ItemDataBound
protected void lvLinks_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
var item = e.Item.DataItem as Item;
var phLink = e.Item.FindControl("phLink") as PlaceHolder;
switch(item.TemplateID.ToString())
{
case Constants.TemplateIDs.ApplicationShortcut:
var lnkItem = new HyperLink();
lnkItem.Text = StringUtil.GetString(item.Fields[Constants.FieldIDs.ApplicationShortcutDisplayName].Value, item.DisplayName);
lnkItem.Attributes["href"] = "#";
lnkItem.Attributes["onclick"] = string.Format("javascript:scForm.postRequest('', '', '', 'appshortcut:open(appid={0})'); return false;", item.ID);
phLink.Controls.Add(lnkItem);
break;
case Constants.TemplateIDs.Link:
var link = new Sitecore.Web.UI.WebControls.Link()
{
Item = item,
Field = Constants.FieldIDs.LinkLink
};
if (string.IsNullOrEmpty(link.Text))
{
link.Text = item.DisplayName;
}
phLink.Controls.Add(link);
break;
}
}
}
示例10: MemberSectionList_OnItemDataBound
protected void MemberSectionList_OnItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
ListViewDataItem dataItem = (ListViewDataItem)e.Item;
var module = dataItem.DataItem as MembershipStaticPageItem;
if (module != null)
{
string EnqFormUrl;
if (module.Offer.Item != null)
{
//Get offer
OfferItem offer = (OfferItem)module.Offer.Item;
EnqFormUrl = enqForm.Url + "?sc_trk=enq&page=" + offer.GetOfferTypeValue() + "&offerId=" + offer.OfferId.Raw + "&clubId=" + currentClub.ClubId.Raw;
}
else
{
EnqFormUrl = enqForm.Url + "?sc_trk=enq&c=" + currentClub.InnerItem.ID.ToShortID().ToString();
}
module.FormUrl = EnqFormUrl;
Literal ltrFormLink = (Literal)e.Item.FindControl("ltrFormLink");
ltrFormLink.Text = "<a href=\"" + EnqFormUrl + "\" class=\"btn btn-cta-big gaqTag\" data-gaqcategory=\"CTA\" data-gaqaction=\"EnquireNow\" data-gaqlabel=\"Membership\">" + Translate.Text("Enquire now") + "</a>";
}
}
}
示例11: lstMyStock_ItemDataBound
void lstMyStock_ItemDataBound(object sender, ListViewItemEventArgs e)
{
int mIndex = Convert.ToInt32(e.Item.ID.Replace("ctrl", ""));
StockAnalyzer mSA = new StockAnalyzer();
if (e.Item.ItemType == ListViewItemType.DataItem)
{
ListViewDataItem mLvdi = (ListViewDataItem)e.Item;
DataRowView mDrv = (DataRowView)mLvdi.DataItem;
//ID,Code,Count,BuyPatternCode,BuyPattern,BuyDate,BuyCost,SelPatternCode,SelPattern,SelDate,SelCost
string mCode = mDrv["Code"].ToString();
string mBuyDate = mDrv["BuyDate"].ToString();
string mBuyCost = mDrv["BuyCost"].ToString();
string mSelPatternCode = mDrv["SelPatternCode"].ToString();
string mSelPattern = mDrv["SelPattern"].ToString();
string mSelDate = mDrv["SelDate"].ToString();
string mSelCost = mDrv["SelCost"].ToString();
string mSelPattern_Cost = mSelPattern.Split('&')[0];
string mSelPattern_Trade = mSelPattern.Split('&')[1];
string[] mCosts = mSelPattern_Cost.Split(',');
double mMinCost = 100000000;
for (int i = 0; i < mCosts.Length; i++)
{
if (Convert.ToDouble(mCosts[i]) < mMinCost)
{
mMinCost = Convert.ToDouble(mCosts[i]);
}
}
string[] mTrades = mSelPattern_Trade.Split(',');
double mMinTrade = 100000000;
for (int i = 0; i < mTrades.Length; i++)
{
string mtest = mTrades[i];
if (Convert.ToDouble(mTrades[i]) < mMinTrade)
{
mMinTrade = Convert.ToDouble(mTrades[i]);
}
}
if (Convert.ToInt32(mBuyCost) < Convert.ToInt32(mSelCost))
{
mSelCost = "<span style='color:#ff0000'>" + mSelCost + "</span>";
}
else
{
mSelCost = "<span style='color:#3366ff'>" + mSelCost + "</span>";
}
((Literal)e.Item.FindControl("litDetailComment")).Text = mDrv["Code"].ToString() + "(매도패턴코드 : " + mSelPatternCode + ", 매수가 : " + mBuyCost + ", 매도가 : " + mSelCost + ")";
((Literal)e.Item.FindControl("litChart")).Text = GetChartScript(mIndex.ToString(), mSelPattern_Cost, mSelPattern_Trade, (mMinCost - 1), (mMinTrade - 1));
}
mSA = null;
}
示例12: lvUserRole_ItemDataBound
protected void lvUserRole_ItemDataBound(object sender, ListViewItemEventArgs e)
{
//当前行
var itm = e.Item;
//显示值
if (itm.ItemType == ListViewItemType.DataItem)
{
//全部DropDownList
var ddlUser = (DropDownList)itm.FindControl("ddlUser");
var ddlProc = (DropDownList)itm.FindControl("ddlProc");
var ddlRole = (DropDownList)itm.FindControl("ddlRole");
//当前数据行
var row = (DataSetUserRole.t_user_proc_roleRow)((DataRowView)itm.DataItem).Row;
if (row != null)
{
//取得当前项
var itemUser = ddlUser.Items.FindByValue(row.u_id.ToString());
var itemProc = ddlProc.Items.FindByValue(row.proc_id.ToString());
var itemRole = ddlRole.Items.FindByValue(row.ro_id.ToString());
//设置值
if (itemUser != null && itemProc != null && itemRole != null)
{
itemUser.Selected = true;
itemProc.Selected = true;
itemRole.Selected = true;
}
}
}
}
示例13: WidgetList_OnItemDataBound
protected void WidgetList_OnItemDataBound(object sender, ListViewItemEventArgs e)
{
//if (e.Item.ItemType == ListViewItemType.DataItem)
//{
// ListViewDataItem dataItem = (ListViewDataItem)e.Item;
// var widgetItem = dataItem.DataItem as LinkWidgetItem;
// if (widgetItem != null)
// {
// //Get link url
// var linkUrl = e.Item.FindControl("linkUrl") as System.Web.UI.WebControls.Literal;
// if (linkUrl != null)
// {
// if (isClubSection)
// {
// //get clubID
// ClubItem club = new ClubItem(Sitecore.Context.Item.Axes.SelectSingleItem(String.Format(@"ancestor-or-self::*[@@tid=""{0}"" or @@tid=""{1}""]", ClassicClubItem.TemplateId, LifeCentreItem.TemplateId)));
// //append club id to url
// if (club != null)
// {
// linkUrl.Text = widgetItem.Widget.Buttonlink.Url.IndexOf("?") == -1 ? widgetItem.Widget.Buttonlink.Url + "&c=" + club.ID.ToString() : widgetItem.Widget.Buttonlink.Url + "?c=" + club.ID.ToString();
// }
// }
// else
// {
// linkUrl.Text = widgetItem.Widget.Buttonlink.Url;
// }
// }
// }
//}
}
示例14: CategoriesList1_ItemDataBound
protected void CategoriesList1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
List<CategoriesDL> dt = (List<CategoriesDL>)CategoriesList1.DataSource;
CategoriesDL row = dt[recindex1];
HyperLink clink = (HyperLink)e.Item.FindControl("CatLink");
if (cityID > 0 && areaID > 0)
{
clink.NavigateUrl = String.Concat(basedomain, "/blog/", row.CatUrlName, "/", CityDL.GetCityUrlByID(cityID), "/", AreaDL.GetAreaUrlByID(areaID));
}
else
{
clink.NavigateUrl = String.Concat(basedomain, "/blog/", row.CatUrlName);
}
clink.Text = row.Name;
if ((row.Id != Convert.ToInt32(catid)) && catid != "0")
{
clink.Attributes.Add("rel", "nofollow");
}
if (row.Id == Convert.ToInt32(catid))
{
clink.CssClass += " selected";
}
recindex1++;
}
}
示例15: lstTask_DataBound
protected void lstTask_DataBound(object sender, ListViewItemEventArgs e)
{
Button btnClaim;
Label lblHeat, lblDocs, lblOther;
Dictionary<string, string> cred = getCredentials(Session["secureuser"].ToString());
//Show the claim task button only if the current task is assigned to current users section
if (e.Item.ItemType == ListViewItemType.DataItem)
{
System.Data.DataRowView rowView = e.Item.DataItem as System.Data.DataRowView;
btnClaim = (Button)e.Item.FindControl("btnClaim");
lblHeat = (Label)e.Item.FindControl("lblHeat");
lblDocs = (Label)e.Item.FindControl("lblDocs");
lblOther = (Label)e.Item.FindControl("lblOther");
string SectionID = rowView["Section_ID"].ToString();
string EmployeeID = rowView["Employee_ID"].ToString();
string HeatID = rowView["Heat_ID"].ToString();
string Docs = rowView["Documentation"].ToString();
string Other = rowView["Other_Resources"].ToString();
string currentUsersSection = cred["sec_id"].ToString();
if (btnClaim != null)
{
if (currentUsersSection == SectionID & EmployeeID == "")
{
btnClaim.Visible = true;
}
}
if (HeatID == "" || HeatID == null) { lblHeat.Visible = false; }
if (Docs == "" || Docs == null) { lblDocs.Visible = false; }
if (Other == "" || Other == null) { lblOther.Visible = false; }
}
}