当前位置: 首页>>代码示例>>C#>>正文


C# WebControls.DataGridItemEventArgs类代码示例

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


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

示例1: grdSizes_ItemDataBound

 protected void grdSizes_ItemDataBound(object sender, DataGridItemEventArgs e)
 {
     ListItemType itemType = e.Item.ItemType;
     if ((itemType != ListItemType.Footer) && (itemType != ListItemType.Separator))
     {
         if (itemType == ListItemType.Header)
         {
             object checkBox = e.Item.FindControl("chkSelectAll");
             if ((checkBox != null))
             {
                 ((CheckBox)checkBox).Attributes.Add("onClick", "Javascript:chkSelectAll_OnClick(this)");
             }
         }
         else
         {
             string tableRowId = grdSizes.ClientID + "_row" + e.Item.ItemIndex.ToString();
             e.Item.Attributes.Add("id", tableRowId);
             object checkBox = e.Item.FindControl("chkSelect");
             if ((checkBox != null))
             {
                 e.Item.Attributes.Add("onMouseMove", "Javascript:chkSelect_OnMouseMove(this)");
                 e.Item.Attributes.Add("onMouseOut", "Javascript:chkSelect_OnMouseOut(this," + e.Item.ItemIndex.ToString() + ")");
                 ((CheckBox)checkBox).Attributes.Add("onClick", "Javascript:chkSelect_OnClick(this," + e.Item.ItemIndex.ToString() + ")");
             }
         }
     }
 }
开发者ID:HoangNgocThin,项目名称:thietbimoitruong,代码行数:27,代码来源:Sizes.aspx.cs

示例2: dgDataList_ItemDataBound

 protected void dgDataList_ItemDataBound(object sender, DataGridItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         e.Item.CssClass = "show";
     }
 }
开发者ID:scalzdp,项目名称:studydoc,代码行数:7,代码来源:WebForm3.aspx.cs

示例3: dgTests_ItemDataBound

        private void dgTests_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            Label lblSub, lblEval, lblQueue;
            System.Web.UI.WebControls.Image imgStatus;
            if (null != (lblSub = (Label) e.Item.FindControl("lblSub"))) {
                lblEval = (Label) e.Item.FindControl("lblEval");
                lblQueue = (Label) e.Item.FindControl("lblQueue");
                imgStatus = (System.Web.UI.WebControls.Image) e.Item.FindControl("imgStatus");

                AutoJobTest test = (AutoJobTest) e.Item.DataItem;
                lblEval.Text = test.AutoEval.Name;

                Components.Submission sub =
                    new Submissions(Globals.CurrentIdentity).GetInfo(test.SubmissionID);
                lblSub.Text = new FileSystem(Globals.CurrentIdentity).GetFile(sub.LocationID).Alias;

                if (test.Status == AutoJobTest.DONE)
                    imgStatus.ImageUrl = "../../attributes/subgrade.gif";
                else
                    imgStatus.ImageUrl = "../../attributes/sub.gif";

                AutoJobs autojobda = new AutoJobs(Globals.CurrentIdentity);
                lblQueue.Text = String.Format("{0} out of {1}",
                    autojobda.GetQueuePosition(test), autojobda.GetAllTests().Count);
            }
        }
开发者ID:padilhalino,项目名称:FrontDesk,代码行数:26,代码来源:autojobtests.ascx.cs

示例4: GridItemList_ItemDataBound

 protected void GridItemList_ItemDataBound(object sender, DataGridItemEventArgs e)
 {
     if ((((e.Item.ItemType == ListItemType.Item) | (e.Item.ItemType == ListItemType.AlternatingItem)) | (e.Item.ItemType == ListItemType.SelectedItem)))
     {
         e.Item.Cells[4].Attributes.Add("onClick", "return confirm('Bạn có chắc chắn xóa?');");
     }
 }
开发者ID:htphongqn,项目名称:truongcaodangngheytebinhduong,代码行数:7,代码来源:size_list.aspx.cs

示例5: DataGrid_ItemDataBound

        private void DataGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            #region 设置数据绑定的长度

            switch (e.Item.ItemType)
            {
                case ListItemType.Item:
                    break;
                case ListItemType.AlternatingItem:
                    break;
                case ListItemType.Header:
                    e.Item.Cells[0].ColumnSpan = 1; //合并单元格 
                    e.Item.Cells[1].Visible = false;
                    break;
                case ListItemType.EditItem:
                    {
                        for (int i = 0; i < DataGrid1.Columns.Count; i++) //只调整被编辑的列 
                        {
                            if (e.Item.ItemType == ListItemType.EditItem)
                            {
                                if (i >= 3)
                                {
                                    System.Web.UI.WebControls.TextBox txt = (System.Web.UI.WebControls.TextBox)e.Item.Cells[i].Controls[0];
                                    txt.Width = 60;
                                }
                            }
                        }
                        break;
                    }
                default:
                    break;
            }

            #endregion
        }
开发者ID:ichari,项目名称:ichari,代码行数:35,代码来源:global_scoreset.aspx.cs

示例6: SlotsDataGrid_ItemDataBound

        protected void SlotsDataGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            switch (e.Item.ItemType)
            {
                case ListItemType.AlternatingItem:

                case ListItemType.Item:
                    if (e.Item.Cells[6].Text.Equals("SubHeading"))
                    {
                        DateTime myDate = DateTime.Parse(e.Item.Cells[0].Text.ToString());
                        e.Item.Cells[1].Text = myDate.DayOfWeek.ToString() + " " + myDate.Day + " " + returnMonth(myDate.Month).ToString().ToLower();

                        //De breedte van de toegevoegde subheader
                        e.Item.Cells[1].ColumnSpan = e.Item.Cells.Count;
                        e.Item.Cells[1].CssClass = "DayRow";

                        //De overigge cellen verwijderen
                        for (int i = e.Item.Cells.Count - 1; i > 1; i--)
                            e.Item.Cells.RemoveAt(i);
                    }
                    break;
                default:
                    break;
            }
        }
开发者ID:Gi11i4m,项目名称:scrumbags,代码行数:25,代码来源:Home.aspx.cs

示例7: grid_ItemDataBound

        protected void grid_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                string Dormancy = (string)DataBinder.Eval(e.Item.DataItem, "Dormancy");
                int ClassId = (int)DataBinder.Eval(e.Item.DataItem, "ClassId");
                if (Dormancy.ToLower() == "true")
                {
                    e.Item.Cells[4].Text = "<span style=\" color:Red\">����</span>";
                }
                else
                {
                    e.Item.Cells[4].Text = "<span style=\" color:Green\">����</span>";
                }

                Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
                Maticsoft.Model.NewsManage.NewsClass mod = bll.GetModelByCache(ClassId);
                if (mod != null)
                {
                    e.Item.Cells[5].Text = mod.ClassDesc;
                }
                else
                {
                    e.Item.Cells[5].Text = "δ֪���";
                }
            }
        }
开发者ID:chinasio,项目名称:Control,代码行数:27,代码来源:Release.aspx.cs

示例8: dgNewContent_ItemDataBound

        protected void dgNewContent_ItemDataBound(Object sender, DataGridItemEventArgs e)
        {
            switch(e.Item.ItemType)
            {
                case ListItemType.Header:
                    ((Literal)e.Item.Cells[2].FindControl("litTitleHeader")).Text = "Title";
                    ((Literal)e.Item.Cells[3].FindControl("litIdHeader")).Text = "ID";
                    ((Literal)e.Item.Cells[4].FindControl("litLastEditorHeader")).Text = "Submitted By";
                    ((Literal)e.Item.Cells[5].FindControl("litModifiedDateHeader")).Text = "Modified Date";
                    ((Literal)e.Item.Cells[6].FindControl("litPathHeader")).Text = "Path";
                    break;
                case ListItemType.Item:
                case ListItemType.AlternatingItem:
                    ((Image)e.Item.Cells[1].FindControl("imgContentIcon")).AlternateText = ((ContentData)e.Item.DataItem).Title;
                    ((Image)e.Item.Cells[1].FindControl("imgContentIcon")).ImageUrl = GetImagePath(((ContentData)e.Item.DataItem));
                    ((Image)e.Item.Cells[1].FindControl("imgContentIcon")).Attributes.Add("title", ((ContentData)e.Item.DataItem).Title);

                    ((HyperLink)e.Item.Cells[2].FindControl("aTitle")).NavigateUrl = GetTitleHref(((ContentData)e.Item.DataItem));
                    ((HyperLink)e.Item.Cells[2].FindControl("aTitle")).Text = ((ContentData)e.Item.DataItem).Title;
                    ((HyperLink)e.Item.Cells[2].FindControl("aTitle")).Attributes.Add("title", ((ContentData)e.Item.DataItem).Title);

                    ((Literal)e.Item.Cells[3].FindControl("litIdValue")).Text = ((ContentData)e.Item.DataItem).Id.ToString();

                    ((HyperLink)e.Item.Cells[4].FindControl("aLastEditor")).NavigateUrl = GetLastEditorHref(((ContentData)e.Item.DataItem));
                    ((HyperLink)e.Item.Cells[4].FindControl("aLastEditor")).Text = ((ContentData)e.Item.DataItem).EditorLastName + ", " + ((ContentData)e.Item.DataItem).EditorFirstName;
                    ((HyperLink)e.Item.Cells[4].FindControl("aLastEditor")).Attributes.Add("title", ((ContentData)e.Item.DataItem).EditorLastName + ", " + ((ContentData)e.Item.DataItem).EditorFirstName);

                    ((Literal)e.Item.Cells[3].FindControl("litModifiedDateValue")).Text = ((ContentData)e.Item.DataItem).DisplayLastEditDate;

                    ((HyperLink)e.Item.Cells[2].FindControl("aPathValue")).NavigateUrl = GetPathHref(((ContentData)e.Item.DataItem));
                    ((HyperLink)e.Item.Cells[2].FindControl("aPathValue")).Text = ((ContentData)e.Item.DataItem).Path;
                    ((HyperLink)e.Item.Cells[2].FindControl("aPathValue")).Attributes.Add("title", ((ContentData)e.Item.DataItem).Path);
                    break;
            }
        }
开发者ID:jaytem,项目名称:minGit,代码行数:35,代码来源:NewContent.ascx.cs

示例9: dgTemplate_itemdatabound

 protected void dgTemplate_itemdatabound(object sender, DataGridItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         ((CheckBox)e.Item.FindControl("ckbAllowTemplate")).Checked = true;
     }
 }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:7,代码来源:EditNodeTypeNew.aspx.cs

示例10: DataGrid_ItemDataBound

        private void DataGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            #region 绑定附件类型显示方式

            if (e.Item.ItemType == ListItemType.EditItem)
            {
                TextBox t = (TextBox)e.Item.Cells[3].Controls[0];
                t.Attributes.Add("maxlength", "255");
                t.Attributes.Add("size", "30");

                t = (TextBox)e.Item.Cells[4].Controls[0];
                t.Attributes.Add("maxlength", "9");
                t.Attributes.Add("size", "10");
            }

            if ((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item))
            {
                if (e.Item.Cells[3].Text.ToString().Length > 40)
                {
                    e.Item.Cells[3].Text = e.Item.Cells[3].Text.Substring(0, 40) + "…";
                }
            }

            #endregion
        }
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:25,代码来源:forum_attachtypesgrid.aspx.cs

示例11: dgJobs_ItemDataBound

 private void dgJobs_ItemDataBound(object sender, DataGridItemEventArgs e)
 {
     Label lblProgress;
     if (null != (lblProgress = (Label) e.Item.FindControl("lblProgress"))) {
         lblProgress.Text = GetProgress((AutoJob)e.Item.DataItem);
     }
 }
开发者ID:padilhalino,项目名称:FrontDesk,代码行数:7,代码来源:autojobs.ascx.cs

示例12: BoxGuid_ItemCreated

 protected void BoxGuid_ItemCreated(object sender, DataGridItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.SelectedItem)
     {
         e.Item.Cells[0].Text = "<p align=center>" + Convert.ToString(e.Item.ItemIndex + 1) + "</p>";
     }
 }
开发者ID:kingofhawks,项目名称:kcsj,代码行数:7,代码来源:ConsultBoxMana.aspx.cs

示例13: grdMain_ItemCreated

		protected void grdMain_ItemCreated(object sender, DataGridItemEventArgs e)
		{
			if ( e.Item.ItemType == ListItemType.Header || e.Item.ItemType == ListItemType.Footer )
			{
				e.Item.CssClass += " nodrag nodrop";
			}
		}
开发者ID:huamouse,项目名称:Taoqi,代码行数:7,代码来源:ListView.ascx.cs

示例14: dgUserCourses_ItemDataBound

        private void dgUserCourses_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            HyperLink hypAdmin, hypStudent, hypStudentAdmin;
            if (null != (hypAdmin = (HyperLink) e.Item.FindControl("hypAdmin"))) {
                Course course = (Course) e.Item.DataItem;
                CourseRole role = new Courses(Globals.CurrentIdentity).GetRole(
                    Globals.CurrentUserName, course.ID, null);

                hypStudent = (HyperLink) e.Item.FindControl("hypStudent");
                hypStudentAdmin = (HyperLink) e.Item.FindControl("hypStudentAdmin");

                hypStudent.Enabled = course.Available;
                hypStudentAdmin.Enabled = course.Available;
                if (!hypStudent.Enabled)
                    hypStudent.Text += " (Unavailable)";

                if (role.Staff) {
                    hypAdmin.NavigateUrl = "../courseadmin.aspx?CourseID="+course.ID;
                    hypAdmin.Visible = true;
                    hypStudentAdmin.NavigateUrl = "../course.aspx?CourseID="+course.ID;
                    hypStudentAdmin.Visible = true;

                } else {
                    hypAdmin.NavigateUrl = "../course.aspx?CourseID="+course.ID;
                    hypAdmin.Visible = false;
                    hypStudentAdmin.Visible = false;
                }
            }
        }
开发者ID:padilhalino,项目名称:FrontDesk,代码行数:29,代码来源:defaultcourses.ascx.cs

示例15: dtgCategory_ItemDataBound

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

                DropDownList ddl = e.Item.FindControl("ddlCat") as DropDownList;
                LoadDdl(ddl);
                int parentid = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "ParentId"));
                if (parentid != 0)
                    ddl.SelectedValue = parentid.ToString();
                CheckBox c = e.Item.FindControl("chkSubCat") as CheckBox;
                bool isSub = (bool)DataBinder.Eval(e.Item.DataItem, "IsSubCat");
                c.Checked = isSub;
                if (isSub)
                    ddl.Visible = true;
                else
                    ddl.Visible = false;

                ImageButton imbDelete = e.Item.FindControl("btnDelete") as ImageButton;
                imbDelete.OnClientClick = "javascript : return confirm('Bạn có chắc muốn xóa không?')";
            }
            else if (e.Item.ItemType == ListItemType.Footer)
            {
                DropDownList ddl = e.Item.FindControl("ddlCat") as DropDownList;
                LoadDdl(ddl);
                ddl.Visible = false;
            }
        }
开发者ID:rainie1392,项目名称:tamviet-huan,代码行数:28,代码来源:CategoryManager.aspx.cs


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