本文整理汇总了C#中System.Web.UI.WebControls.DataGridItemEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridItemEventArgs类的具体用法?C# DataGridItemEventArgs怎么用?C# DataGridItemEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridItemEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataGridItemEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GridView1_ItemDataBound
protected void GridView1_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
{
try
{
if (((Label)e.Item.Cells[4].FindControl("lbl14987")).Text != "3")
{
sum_cost_total += Convert.ToDecimal(((Label)e.Item.Cells[1].FindControl("lbl17")).Text);
}
}
catch
{
ShowJsMessage("港口保安规费费率设置不完整,请至规费设置模块查看");
return;
}
}
if (e.Item.ItemType == ListItemType.Footer)
{
e.Item.Cells[0].Text = "应缴合计:";
e.Item.Cells[1].Text = sum_cost_total.ToString();
this.lblCost.Text = sum_cost_total.ToString();
}
}
开发者ID:inspire88,项目名称:TcportGroupOA,代码行数:25,代码来源:Caw_GKBACost_Detail.aspx.cs
示例17: dtgOrder_ItemDataBound
protected void dtgOrder_ItemDataBound(object sender, DataGridItemEventArgs e)
{
Label lblState = e.Item.FindControl("lblState") as Label;
if (lblState != null)
{
OrderStateEnum state = (OrderStateEnum)DataBinder.Eval(e.Item.DataItem, "State");
if(state==OrderStateEnum.NEW)
{
lblState.Text = "Đơn hàng mới";
lblState.ForeColor = Color.Green;
}
else if (state ==OrderStateEnum.PROCESSING)
{
lblState.Text = "Đơn hàng đang xử lí";
lblState.ForeColor = Color.Blue;
}
else if (state ==OrderStateEnum.CANCEL)
{
lblState.Text = "Đơn hàng huỷ";
lblState.ForeColor = Color.Red;
}
else if (state == OrderStateEnum.COMPLETE)
{
lblState.Text = "Đơn hàng đã hoàn thành";
lblState.ForeColor = Color.HotPink;
}
}
}
开发者ID:nvphuong92,项目名称:dat-phong-khach-san,代码行数:28,代码来源:ManagerBooking.aspx.cs
示例18: GridCategory_ItemCreated
protected void GridCategory_ItemCreated(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
LinkButton btn = (LinkButton)e.Item.Cells[4].Controls[0];
btn.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this, all sub categories will be deleted as well?')");
}
}
开发者ID:kanchanapy,项目名称:Simple-Product-Catalog-Manager,代码行数:8,代码来源:Categories.aspx.cs
示例19: dgMyArtical_ItemDataBound
protected void dgMyArtical_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
{
Label label = (Label)e.Item.FindControl("lblNum");
label.Text = Convert.ToString((int)(e.Item.ItemIndex + 1)) + ".";
}
}
开发者ID:wjkong,项目名称:MicNets,代码行数:8,代码来源:Default.aspx.cs
示例20: OnItemDataBound
protected override void OnItemDataBound(DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
e.Item.Attributes.Add("onmouseover", "this.className = \"over\";");
e.Item.Attributes.Add("onmouseout", "this.className = this.className.replace(\"over\", \"\");");
}
base.OnItemDataBound(e);
}
开发者ID:montyclift,项目名称:dashcommerce-3,代码行数:8,代码来源:DataGrid.cs
注:本文中的System.Web.UI.WebControls.DataGridItemEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论