• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DataListItemEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DataListItemEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DataListItemEventArgs类的具体用法?C# DataListItemEventArgs怎么用?C# DataListItemEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataListItemEventArgs类属于命名空间,在下文中一共展示了DataListItemEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: list_ItemDataBound

    protected void list_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        DataRowView dataRow = (DataRowView)e.Item.DataItem;
        string productId = dataRow["ProductID"].ToString();
        DataTable attrTable = CatalogAccess.GetProductAttributes(productId);

        string prevAttributeName = "";
        string attributeName, attributeValue, attributeValueId;
        Label attributeNameLabel;
        PlaceHolder attrPlaceHolder = (PlaceHolder)e.Item.FindControl("attrPlaceHolder");
        DropDownList attributeValuesDropDown = new DropDownList();

        foreach (DataRow r in attrTable.Rows)
        {
            attributeName = r["AttributeName"].ToString();
            attributeValue = r["AttributeValue"].ToString();
            attributeValueId = r["AttributeValueID"].ToString();

            if (attributeName != prevAttributeName)
            {
                prevAttributeName = attributeName;
                attributeNameLabel = new Label();
                attributeNameLabel.Text = attributeName + ": ";
                attributeValuesDropDown = new DropDownList();
                attrPlaceHolder.Controls.Add(attributeNameLabel);
                attrPlaceHolder.Controls.Add(attributeValuesDropDown);
            }

            attributeValuesDropDown.Items.Add(new ListItem(attributeValue, attributeValueId));
        }
    }
开发者ID:priya-sudarshanam,项目名称:C-Sharp-Experiments,代码行数:31,代码来源:ProductsList.ascx.cs


示例2: datListGeneral_ItemDataBound

    protected void datListGeneral_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        Label lblImage = e.Item.FindControl("lblImage") as Label;
        Image imgPicture = e.Item.FindControl("imgPicture") as Image;

        imgPicture.ImageUrl = "~/Uploads/" + lblImage.Text;
    }
开发者ID:waliul-cse,项目名称:An-Eommerce-website-Development-Project,代码行数:7,代码来源:Default.aspx.cs


示例3: dlContact_ItemDataBound

 //Contact 替換關鍵字查詢的顏色
 protected void dlContact_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         new IMAUtil().RepKW(e.Item.Controls);
     }
 }
开发者ID:AdamsChao,项目名称:netdb-localdev-proj,代码行数:8,代码来源:ImaDetailQ.aspx.cs


示例4: DataList1_ItemDataBound

    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.EditItem)
        {
            DropDownList ddlGradeCourseSubject = (DropDownList)e.Item.FindControl("ddlGradeCourseSubject");
            ddlGradeCourseSubject.DataTextField = "CourseSubjectName";
            ddlGradeCourseSubject.DataValueField = "id";
            DataTable dt = (DataTable)ViewState["CourseByGrade"];
            ddlGradeCourseSubject.DataSource = dt;
            ddlGradeCourseSubject.DataBind();
            DataRowView row = (DataRowView)e.Item.DataItem; //取得繫節過來那一筆DataRow
            if (!string.IsNullOrEmpty(row["GradeCourseSubjectID"].ToString()))
            {
                ddlGradeCourseSubject.SelectedValue = row["GradeCourseSubjectID"].ToString();
            }

        }
        if(e.Item.ItemType== ListItemType.Item || e.Item.ItemType== ListItemType.AlternatingItem)
        {
            Person myPerson = new Person();
            if (myPerson.Role == Person.LoginRole.Administrator)
            {
                Panel addPan = (Panel)e.Item.FindControl("addPan");
                addPan.Visible = false;

            }
        }
    }
开发者ID:Letractively,项目名称:dilas,代码行数:28,代码来源:_Grade_DefaultTimeTable.aspx.cs


示例5: dlPassengers_ItemDataBound

    protected void dlPassengers_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType != ListItemType.Footer && e.Item.ItemType != ListItemType.Header)
        {
            Label lbl = (Label)e.Item.FindControl("Label3");

            if (lbl.Text.Trim() == "0".Trim())
            {
                lbl.Text = "Mr";
            }
            if (lbl.Text.Trim() == "1".Trim())
            {
                lbl.Text = "Mrs";
            }
            if (lbl.Text.Trim() == "2".Trim())
            {
                lbl.Text = "Ms";
            }
            if (((Label)e.Item.FindControl("lbBirth")).Text.Trim() != "")
            {
                DateTime birthDay = Convert.ToDateTime(((Label)e.Item.FindControl("lbBirth")).Text);
                if (IsDateTimeCurrent(birthDay))
                {
                    ((Label)e.Item.FindControl("lbBirth")).Visible = true;
                    ((Label)e.Item.FindControl("lbBirth")).Text = Convert.ToDateTime(((Label)e.Item.FindControl("lbBirth")).Text).ToString("MM/dd/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
                }
                else
                {
                    ((Label)e.Item.FindControl("lbBirth")).Visible = false;
                }
            }
        }
    }
开发者ID:foxvirtuous,项目名称:MVB2C,代码行数:33,代码来源:HTLTravelerControl.ascx.cs


示例6: dlEstimate_ItemDataBound

    protected void dlEstimate_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Footer)
        {
            Label lblCurrent = e.Item.FindControl("lblCurrentPage") as Label;
            Label lblCount = e.Item.FindControl("lblCount") as Label;
            LinkButton lbtnFirst = e.Item.FindControl("lbtnFirst") as LinkButton;
            LinkButton lbtnPre = e.Item.FindControl("lbtnPre") as LinkButton;
            LinkButton lbtnNext = e.Item.FindControl("lbtnNext") as LinkButton;
            LinkButton lbtnLast = e.Item.FindControl("lbtnLast") as LinkButton;

            lblCurrent.Text = "第" + (pds.CurrentPageIndex + 1).ToString() + "页";
            lblCount.Text = "共" + pds.PageCount.ToString() + "页";
            if (pds.IsFirstPage)
            {
                lbtnFirst.Enabled = false;
                lbtnPre.Enabled = false;
            }
            if (pds.IsLastPage)
            {
                lbtnNext.Enabled = false;
                lbtnLast.Enabled = false;
            }
        }
    }
开发者ID:zjplus,项目名称:phoneSys,代码行数:25,代码来源:GoodsInfo.aspx.cs


示例7: dlFlights_ItemDataBound

    protected void dlFlights_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {

        }
    }
开发者ID:foxvirtuous,项目名称:MVB2C,代码行数:7,代码来源:TourFlightDetailInMailControl.ascx.cs


示例8: dlPictrue_ItemDataBound

 protected void dlPictrue_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Footer)
     {
         //以下六个为得到脚模板中的控件,并创建变量.
         Label CurrentPage = e.Item.FindControl("labCurrentPage") as Label;
         Label PageCount = e.Item.FindControl("labPageCount") as Label;
         LinkButton FirstPage = e.Item.FindControl("lnkbtnFirst") as LinkButton;
         LinkButton PrePage = e.Item.FindControl("lnkbtnFront") as LinkButton;
         LinkButton NextPage = e.Item.FindControl("lnkbtnNext") as LinkButton;
         LinkButton LastPage = e.Item.FindControl("lnkbtnLast") as LinkButton;
         CurrentPage.Text = (pds.CurrentPageIndex + 1).ToString();//绑定显示当前页
         PageCount.Text = pds.PageCount.ToString();//绑定显示总页数
         if (pds.IsFirstPage)//如果是第一页,首页和上一页不能用
         {
             FirstPage.Enabled = false;
             PrePage.Enabled = false;
         }
         if (pds.IsLastPage)//如果是最后一页"下一页"和"尾页"按钮不能用
         {
             NextPage.Enabled = false;
             LastPage.Enabled = false;
         }
     }
 }
开发者ID:kinggod,项目名称:21SourceCode,代码行数:25,代码来源:UserLogin.aspx.cs


示例9: rptDataBound

 protected void rptDataBound(object sender, DataListItemEventArgs e)
 {
     try
     {
         string str = Server.HtmlDecode(ds.Tables[0].Rows[e.Item.ItemIndex]["Article"].ToString());
         Match m = Regex.Match(str, @"<img(.|\n)+?>");
         Image ArticleImage = (Image)e.Item.FindControl("img");
         if (!string.IsNullOrEmpty(ds.Tables[0].Rows[e.Item.ItemIndex]["Thumbnail"].ToString()))
         {
             System.Drawing.Bitmap bmp = customTransactions.RezizeImage(Server.MapPath(ds.Tables[0].Rows[e.Item.ItemIndex]["Thumbnail"].ToString()), 110, 80, ArticleImage);
             ArticleImage.ImageUrl = ds.Tables[0].Rows[e.Item.ItemIndex]["Thumbnail"].ToString();
         }
         else if (m.Success)
         {
             Match inner = Regex.Match(m.Value, "src=[\'|\"](.+?)[\'|\"]");
             if (inner.Success)
             {
                 string imageurl = inner.Value.Substring(5).Substring(0, inner.Value.Substring(5).LastIndexOf("\""));
                 System.Drawing.Bitmap bmp = customTransactions.RezizeImage(Server.MapPath(imageurl), 110, 80, ArticleImage);
                 ArticleImage.ImageUrl = inner.Value.Substring(5).Substring(0, inner.Value.Substring(5).LastIndexOf("\""));
             }
         }
     }
     catch (Exception ex)
     {
         UserInfo info = UserController.GetCurrentUserInfo();
         ErrorLog objLog = new ErrorLog();
         objLog.ErrorDescription = ex.ToString();
         objLog.ErrorDate = DateTime.Now;
         objLog.ErrorFunctionName = "Page Load";
         objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
         objLog.ErrorLoggedInUser = info.Username;
         objLog.AddErrorToLog(objLog);
     }
 }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:35,代码来源:HomeDepartments.ascx.cs


示例10: dlTourProduct_ItemDataBound

    protected void dlTourProduct_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Label lbl_HasAir = (Label)e.Item.FindControl("lbl_HasAir");
            Label lbl_DeptFrom = (Label)e.Item.FindControl("lbl_DeptFrom");
            Label lbl_Disp = (Label)e.Item.FindControl("lblDisp");
            Label lbl_PriceValue = (Label)e.Item.FindControl("lbl_PriceValue");
            HtmlTableRow trIsShowAirline = (HtmlTableRow)e.Item.FindControl("trIsShowAirline");

            TourMaterial tourMaterial= (TourMaterial)(((System.Object)(((System.Web.UI.WebControls.DataListItem)(e.Item)).DataItem)));
            //lbl_PriceValue.Text = ((TourProfile)tourMaterial.Profile)..
            if (((TourSearchCondition)this.Transaction.CurrentSearchConditions).IsLandOnly)
            {
                lbl_HasAir.Visible = lbl_DeptFrom.Visible = lbl_Disp.Visible = false;
                lbl_PriceValue.Text = ((Terms.Product.Business.MVTourProfile)tourMaterial.Profile).StartFromLandOnlyFare.ToString("n", System.Globalization.CultureInfo.CurrentUICulture.NumberFormat);
                trIsShowAirline.Visible = false;
            }
            else
            {
                lbl_DeptFrom.Text = ((Terms.Product.Business.MVTourProfile)tourMaterial.Profile).DefaultDepartureCity.Name + ")";
                lbl_PriceValue.Text = ((Terms.Product.Business.MVTourProfile)tourMaterial.Profile).StartFromAirLandFare.ToString("n", System.Globalization.CultureInfo.CurrentUICulture.NumberFormat);
            }

            //if (((TourProfile)tourMaterial.Profile).Airlines.Count==0)
            //    trIsShowAirline.Visible=false;

            Image img = (Image)e.Item.FindControl("imgTour");
            img.ImageUrl = img.ImageUrl.ToString().Replace("~/", string.Empty);
        }
    }
开发者ID:foxvirtuous,项目名称:MVB2C,代码行数:31,代码来源:TourSearchResultForm.aspx.cs


示例11: DataList1_ItemDataBound

 protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     int nCount = e.Item.ItemIndex + 1;
     String str = "第"+nCount.ToString()+"题:";
     Label lbl = (Label)e.Item.FindControl("Label4");
     lbl.Text = str;
 }
开发者ID:getfirstblood,项目名称:course-website,代码行数:7,代码来源:ItemInMark.aspx.cs


示例12: dlApp_ItemDataBound

 // method to select status radio button according to approvalSatatus in the table
 protected void dlApp_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     foreach (DataListItem item in dlApp.Items) 
     {
         if (item.ItemType == ListItemType.Item)
         {
             HiddenField hdfStatus = (HiddenField)e.Item.FindControl("hdfStatus");
             if (hdfStatus.Value == "Pending")
             {
                 RadioButtonList rbApprove = (RadioButtonList)e.Item.FindControl("rbApprove");
                 rbApprove.SelectedValue = "Pending";                    
             }
             else if (hdfStatus.Value == "Accepted")
             {
                 RadioButtonList rbApprove = (RadioButtonList)e.Item.FindControl("rbApprove");
                 rbApprove.SelectedValue = "Accept";
             }
             else if (hdfStatus.Value == "Rejected")
             {
                 RadioButtonList rbApprove = (RadioButtonList)e.Item.FindControl("rbApprove");
                 rbApprove.SelectedValue = "Reject";
             }
         }
     }
 }
开发者ID:resh2302,项目名称:BRDHC-BkUp,代码行数:26,代码来源:approveAppointment.aspx.cs


示例13: DataListvote_ItemDataBound

 protected void DataListvote_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     bool webvotelimit = LearnSite.Common.XmlHelp.WebVote_Limit();
     string wdate = ((Label)e.Item.FindControl("LabelWupdate")).Text;
     if (wdate != "")
     {
         string nowday = DateTime.Now.ToShortDateString();
         DateTime nowdayDt = Convert.ToDateTime(nowday);
         DateTime updateDt = Convert.ToDateTime(wdate);
         if (updateDt > nowdayDt)
         {
             ((LinkButton)e.Item.FindControl("Linkvote")).BackColor = Lbc.BackColor;
         }
     }
     if (!webvotelimit)
     {
         ((LinkButton)e.Item.FindControl("Linkvote")).Enabled = true;
     }
     else
     {
         ((LinkButton)e.Item.FindControl("Linkvote")).Enabled = false;
         Labelmsg.Text = "现在还不可以进行网站投票,请努力制作好你的网站吧!";
     }
     string mystr = "网站现评价得分为:" + ((Label)e.Item.FindControl("LabelWscore")).Text + "分";
     ((HyperLink)e.Item.FindControl("Hypername")).ToolTip = mystr;
 }
开发者ID:dalinhuang,项目名称:learnsite,代码行数:26,代码来源:mysite.aspx.cs


示例14: _dlstPages_ItemDataBound

    protected void _dlstPages_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        try
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                string _insStatus = ((Label)e.Item.FindControl("_lblInsertStatus")).Text;
                if (_insStatus == "1")
                    ((CheckBox)e.Item.FindControl("_chkInsert")).Checked = true;

                string _viewStatus = ((Label)e.Item.FindControl("_lblViewStatus")).Text;
                if (_viewStatus == "1")
                    ((CheckBox)e.Item.FindControl("_chkView")).Checked = true;

                string _editStatus = ((Label)e.Item.FindControl("_lblEditStatus")).Text;
                if (_editStatus == "1")
                    ((CheckBox)e.Item.FindControl("_chkEdit")).Checked = true;

                string _deleteStatus = ((Label)e.Item.FindControl("_lblDeleteStatus")).Text;
                if (_deleteStatus == "1")
                    ((CheckBox)e.Item.FindControl("_chkDelete")).Checked = true;

                string _status = ((Label)e.Item.FindControl("_lblStatus")).Text;
                if (_status == "1")
                    ((CheckBox)e.Item.FindControl("_chkPage")).Checked = true;

            }
        }
        catch (Exception ex)
        {
            ex.Message.ToString();
        }
    }
开发者ID:guarddoggps,项目名称:xtremek-static,代码行数:33,代码来源:SchemeEdit.ascx.cs


示例15: ItemDataBoundFormattingExample_ItemDataBound

    protected void ItemDataBoundFormattingExample_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            // Programmatically reference the ProductsRow instance bound to this DataListItem
            Northwind.ProductsRow product = (Northwind.ProductsRow)((System.Data.DataRowView)e.Item.DataItem).Row;

            // See if the UnitPrice is not NULL and less than $20.00
            if (!product.IsUnitPriceNull() && product.UnitPrice < 20)
            {
                // Highlight the product name and unit price Labels
                // First, get a reference to the two Label Web controls
                Label ProductNameLabel = (Label)e.Item.FindControl("ProductNameLabel");
                Label UnitPriceLabel = (Label)e.Item.FindControl("UnitPriceLabel");

                // Next, set their CssClass properties
                if (ProductNameLabel != null)
                    ProductNameLabel.CssClass = "AffordablePriceEmphasis";

                if (UnitPriceLabel != null)
                    UnitPriceLabel.CssClass = "AffordablePriceEmphasis";

                // Alternatively, you can opt to adjust the style for the *entire* item:
                // e.Item.CssClass = "AffordablePriceEmphasis";
            }
        }
    }
开发者ID:kjeans,项目名称:online-shop,代码行数:27,代码来源:Formatting.aspx.cs


示例16: g_ItemDataBound

 protected void g_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item)) || (e.Item.ItemType == ListItemType.EditItem))
     {
         ShoveConfirmButton button = e.Item.FindControl("btnQuash") as ShoveConfirmButton;
         button.Visible = base._User.Competences.IsOwnedCompetences(Competences.BuildCompetencesList(new string[] { "LotteryIsuseScheme" }));
     }
 }
开发者ID:NoobSkie,项目名称:taobao-shop-helper,代码行数:8,代码来源:SchemeQuash.aspx.cs


示例17: DataListPaging_ItemDataBound

 protected void DataListPaging_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     LinkButton lnkPage = (LinkButton)e.Item.FindControl("Pagingbtn");
     if (lnkPage.CommandArgument.ToString() == CurrentPage.ToString())
     {
         lnkPage.Enabled = false;
     }
 }
开发者ID:warrencohn,项目名称:wie,代码行数:8,代码来源:Default.aspx.cs


示例18: DataList1_ItemDataBound

 protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         LinkButton btnDel = (LinkButton)e.Item.FindControl("lbtnDelete");
         btnDel.Attributes.Add("OnClick", "return confirm('Are you sure to delete this image?');");
     }
 }
开发者ID:asgharlatif,项目名称:HSSWebSite,代码行数:8,代码来源:ProductImages.aspx.cs


示例19: dtlContainer_ItemDataBound

 protected void dtlContainer_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataList dtlContianer = (DataList)e.Item.Parent.Parent.Parent.FindControl("dtlContainer");
         string[] dataKeys = dtlContianer.DataKeys[e.Item.ItemIndex].ToString().Split(',');
     }
 }
开发者ID:SaintLoong,项目名称:ChangWu_IndustryPlatform,代码行数:8,代码来源:HomePage.aspx.cs


示例20: dlList_ItemDataBound

    protected void dlList_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if( !(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem) ) return;

        LinkButton lnkRemove = (LinkButton)e.Item.FindControl("lnkRemove");

        lnkRemove.OnClientClick = string.Format("return confirm('정말로 삭제하시겠습니까?');");
    }
开发者ID:powerumc,项目名称:AspNet-Blog,代码行数:8,代码来源:MemberList.ascx.cs



注:本文中的DataListItemEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataLoadOptions类代码示例发布时间:2022-05-24
下一篇:
C# DataListCommandEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap