本文整理汇总了C#中DataGridItemEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridItemEventArgs类的具体用法?C# DataGridItemEventArgs怎么用?C# DataGridItemEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataGridItemEventArgs类属于命名空间,在下文中一共展示了DataGridItemEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectionList_ItemDataBound
void ProjectionList_ItemDataBound(object sender, DataGridItemEventArgs e)
{
string memo = e.Item.Cells[2].Text;
memo = memo.Replace("\r\n", "<br />");
memo = memo.Replace("\n", "<br />");
e.Item.Cells[2].Text = memo;
}
示例2: gridManage_ItemDataBound
public void gridManage_ItemDataBound(object sender, DataGridItemEventArgs e)
{
switch (e.Item.ItemType)
{
case ListItemType.AlternatingItem:
case ListItemType.Item:
case ListItemType.SelectedItem:
case ListItemType.EditItem:
int id = int.Parse(e.Item.Cells[(int)Cells.id].Text);
bool verified = bool.Parse(e.Item.Cells[(int)Cells.verified].Text);
bool failed = bool.Parse(e.Item.Cells[(int)Cells.failed].Text);
string address = e.Item.Cells[(int)Cells.address].Text;
bool principal = bool.Parse(e.Item.Cells[(int)Cells.principal].Text);
if (verified && ! failed)
{
e.Item.Cells[(int)Cells.resend].Text = string.Empty;
}
if (principal || !verified)
{
e.Item.Cells[(int)Cells.setprincipal].Text = string.Empty;
}
break;
}
}
示例3: _gridRecords_DataBound
protected void _gridRecords_DataBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
AlertData _alert = new AlertData();
MapDataCommon.GetAlert(ref _alert, Session["trkCompany"].ToString(),
deviceID, XtremeK.TimeZone.ToServerTime(e.Item.Cells[4].Text).ToString());
Color item_color = new Color();
if (_alert.AlertType == "Event") {
item_color = ColorTranslator.FromHtml("#FFF26A");
} else if (_alert.AlertType == "Geofence" || _alert.AlertType == "Red Alert" ||
_alert.AlertType == "Speeding") {
item_color = ColorTranslator.FromHtml("#FF766A");
} else {
item_color = ColorTranslator.FromHtml("#61C04E");
}
e.Item.BackColor = item_color;
string html_color = ColorTranslator.ToHtml(item_color);
e.Item.Attributes.Add("id", e.Item.ItemIndex.ToString());
e.Item.Attributes.Add("onclick", "highlightRow(this)");
e.Item.Attributes.Add("onmouseover", "this.style.cursor='pointer';this.style.backgroundColor = '#DCDCDC';");
e.Item.Attributes.Add("onmouseout", "this.style.cursor='pointer';this.style.backgroundColor = '" + html_color + "';");
}
}
示例4: gUserDistills_ItemDataBound
protected void gUserDistills_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem))
{
double num = _Convert.StrToDouble(e.Item.Cells[1].Text, 0.0);
e.Item.Cells[1].Text = (num == 0.0) ? "" : num.ToString("N");
num = _Convert.StrToDouble(e.Item.Cells[2].Text, 0.0);
e.Item.Cells[2].Text = (num == 0.0) ? "" : num.ToString("N");
e.Item.Cells[3].Text = "提款";
switch (e.Item.Cells[4].Text)
{
case "0":
e.Item.Cells[4].Text = "申请状态";
return;
case "1":
e.Item.Cells[4].Text = "已付款";
return;
case "-1":
e.Item.Cells[4].Text = "拒绝提款";
return;
case "-2":
e.Item.Cells[4].Text = "用户撤销提款";
return;
}
e.Item.Cells[4].Text = "处理中...";
}
}
示例5: g_ItemDataBound
protected void g_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem))
{
TextBox box = (TextBox)e.Item.Cells[2].FindControl("tbSystemEndAheadMinute");
box.Text = e.Item.Cells[8].Text;
TextBox box2 = (TextBox)e.Item.Cells[3].FindControl("tbChaseExecuteDeferMinute");
box2.Text = e.Item.Cells[9].Text;
if (e.Item.Cells[7].Text.Replace(" ", "").Trim() == "")
{
box2.Visible = false;
}
int num = _Convert.StrToInt(e.Item.Cells[6].Text, -1);
if (num != this.PreLotteryID)
{
this.PreLotteryID = num;
if (this.PreLotteryColor.Name == Color.Linen.Name)
{
this.PreLotteryColor = Color.White;
}
else
{
this.PreLotteryColor = Color.Linen;
}
}
e.Item.BackColor = this.PreLotteryColor;
box.BackColor = this.PreLotteryColor;
box2.BackColor = this.PreLotteryColor;
}
}
示例6: dataGrid_OnItemDataBound
public void dataGrid_OnItemDataBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
object dataItem = e.Item.DataItem;
HyperLink hlItemTitle = (HyperLink)e.Item.FindControl("hlItemTitle");
if(dataItem.GetType() == typeof(Monks.jkp_Audio))
{
Monks.jkp_Audio audioItem = (Monks.jkp_Audio)dataItem;
hlItemTitle.Text = audioItem.Aud_Title;
hlItemTitle.NavigateUrl = "Media-ViewAudio.aspx?audioid=" + audioItem.Aud_ID.ToString();
}
else if(dataItem.GetType() == typeof(Monks.jkp_Book))
{
Monks.jkp_Book bookItem = (Monks.jkp_Book)dataItem;
hlItemTitle.Text = bookItem.Bk_Title;
hlItemTitle.NavigateUrl = "Media-ViewBook.aspx?bookid=" + bookItem.Bk_ID.ToString();
}
else if(dataItem.GetType() == typeof(Monks.jkp_Video))
{
Monks.jkp_Video videoItem = (Monks.jkp_Video)dataItem;
hlItemTitle.Text = videoItem.Vid_Title;
hlItemTitle.NavigateUrl = "Media-ViewVideo.aspx?videoid=" + videoItem.Vid_ID.ToString();
}
}
}
示例7: g_ItemDataBound
protected void g_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem))
{
if (e.Item.Cells[7].Text == "0")
{
e.Item.Cells[7].Text = "正常登录";
}
else if (e.Item.Cells[7].Text == "1")
{
e.Item.Cells[7].Text = "<font color='red'>密码错误</font>";
}
else if (e.Item.Cells[7].Text == "2")
{
e.Item.Cells[7].Text = "<font color='blue'>冻结登录</font>";
}
else if (e.Item.Cells[7].Text == "3")
{
e.Item.Cells[7].Text = "取回密码";
}
else if (e.Item.Cells[7].Text == "4")
{
e.Item.Cells[7].Text = "清除日志";
}
else
{
e.Item.Cells[7].Text = "其它";
}
}
}
示例8: g_ItemDataBound
protected void g_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem))
{
TableCell cell1 = e.Item.Cells[0];
cell1.Text = cell1.Text + "期";
e.Item.Cells[1].Text = _Convert.ToHtmlCode(e.Item.Cells[1].Text);
e.Item.Cells[2].Text = "倍数:" + e.Item.Cells[2].Text;
double num = _Convert.StrToDouble(e.Item.Cells[3].Text, 0.0);
e.Item.Cells[3].Text = (num == 0.0) ? "" : num.ToString("N");
int num2 = _Convert.StrToInt(e.Item.Cells[6].Text, 0);
long num3 = _Convert.StrToLong(e.Item.Cells[8].Text, -1L);
if (num2 != 0)
{
e.Item.Cells[4].Text = "系统撤单";
}
else if (num3 > 0L)
{
e.Item.Cells[4].Text = "<font color='#330099'>已成功</font>";
e.Item.Cells[5].Text = "<a href='../Home/Room/Scheme.aspx?id=" + num3.ToString() + "' target='_blank'><font color=\"#330099\">查看方案</Font></a>";
}
else
{
e.Item.Cells[4].Text = "<font color='Red'>进行中</font>";
}
}
}
示例9: dgProducts_ItemCreated
protected void dgProducts_ItemCreated(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer)
{
PlaceHolder PlaceHolder1 = (PlaceHolder)e.Item.FindControl("PlaceHolder1");
EasyMenu EasyMenu1 = new EasyMenu();
EasyMenu1.ID = "EasyMenu1_" + e.Item.ItemIndex.ToString();
EasyMenu1.ShowEvent = MenuShowEvent.Always;
EasyMenu1.Position = MenuPosition.Horizontal;
EasyMenu1.StyleFolder = "styles/horizontal1";
EasyMenu1.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu1.ID + "_item1", "Buy for...", "", "", "", ""));
EasyMenu1.AddItem(new OboutInc.EasyMenu_Pro.MenuSeparator(EasyMenu1.ID + "_separator1", "|"));
EasyMenu1.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu1.ID + "_item2", "Rent for...", "", "", "", ""));
EasyMenu1.Width = "100%";
EasyMenu EasyMenu2 = new EasyMenu();
EasyMenu2.ID = "EasyMenu2_" + e.Item.ItemIndex.ToString();
EasyMenu2.ShowEvent = MenuShowEvent.MouseOver;
EasyMenu2.Position = MenuPosition.Vertical;
EasyMenu2.StyleFolder = "styles/horizontal1";
EasyMenu2.AttachTo = EasyMenu1.ID + "_item1";
EasyMenu2.Align = MenuAlign.Right;
switch(e.Item.ItemIndex)
{
case 0:
EasyMenu2.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu2.ID + "_item1", "49.99$ for a piece", "", "", "", ""));
EasyMenu2.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu2.ID + "_item2", "89.99$ for two pieces", "", "", "", ""));
break;
case 1:
EasyMenu2.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu2.ID + "_item1", "29.99$ for a piece", "", "", "", ""));
EasyMenu2.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu2.ID + "_item2", "54.99$ for two pieces", "", "", "", ""));
EasyMenu2.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu2.ID + "_item3", "99.99$ for four pieces", "", "", "", ""));
break;
}
EasyMenu EasyMenu3 = new EasyMenu();
EasyMenu3.ID = "EasyMenu3_" + e.Item.ItemIndex.ToString();
EasyMenu3.ShowEvent = MenuShowEvent.MouseOver;
EasyMenu3.Position = MenuPosition.Vertical;
EasyMenu3.StyleFolder = "styles/horizontal1";
EasyMenu3.AttachTo = EasyMenu1.ID + "_item2";
EasyMenu3.Align = MenuAlign.Right;
switch(e.Item.ItemIndex)
{
case 0:
EasyMenu3.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu3.ID + "_item1", "2.99$ for a day", "", "", "", ""));
EasyMenu3.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu3.ID + "_item2", "4.99$ for two days", "", "", "", ""));
EasyMenu3.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu3.ID + "_item3", "9.99$ for a week", "", "", "", ""));
break;
case 1:
EasyMenu3.AddItem(new OboutInc.EasyMenu_Pro.MenuItem(EasyMenu3.ID + "_item1", "Not Available", "", "", "", ""));
break;
}
PlaceHolder1.Controls.Add(EasyMenu1);
PlaceHolder1.Controls.Add(EasyMenu2);
PlaceHolder1.Controls.Add(EasyMenu3);
}
}
示例10: dgv_bill_QH_ItemDataBound
protected void dgv_bill_QH_ItemDataBound(object sender, DataGridItemEventArgs e)
{
try
{
ListItemType it = (ListItemType)e.Item.ItemType;
if (it == ListItemType.Header ||
it == ListItemType.Footer ||
it == ListItemType.Separator)
return;
DataRowView dr = (DataRowView)e.Item.DataItem;
//Cap nhat
TableCell linkCell = (TableCell)e.Item.Controls[9];
HyperLink h = (HyperLink)linkCell.Controls[0];
// h.NavigateUrl = "statementquerytxn.aspx?tb_Acc=" + TxtAcc_Credit.Text + "&Closing_bal=" + dr["Closing_bal"] + "&due_date=" + dr["due_date"] + "&Min_Due=" + dr["Min_pay"] + "&Open_bal=" + dr["open_bal"] + "&Stmt_date=" + dr["bill_date"] + "&curr_bill=" + dr["Curr_bill"] + "&Last_bill=" + dr["Last_bill"];
h.NavigateUrl = "Statement_Query_QH_Details.aspx?tb_Acc=" + TxtAcc_Credit.Text + "&NGAY_BILL=" + dr["NGAY_BILL"] + "&DUNO_DAUKY=" + dr["DUNO_DAUKY"] + "&DUTHU_DAUKY=" + dr["DUTHU_DAUKY"] + "&TRANO_DUNO=" + dr["TRANO_DUNO"] + "&TRANO_DUTHU=" + dr["TRANO_DUTHU"] + "&DUNO_CUOIKY=" + dr["DUNO_CUOIKY"] + "&DUTHU_CUOIKY=" + dr["DUTHU_CUOIKY"];
}
catch (Exception ex)
{
executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(),ex.Message);
//executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + ex.Message);
//Response.Write("<script>alert('Error in ItemDataBound')</script>");
//Alert.Show("Error in ItemDataBound", this);
Session["Error"] = "Error in ItemDataBound!!!";
Response.Redirect("~/Secure/Error_show.aspx");
}
}
示例11: g_ItemDataBound
protected void g_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem))
{
TableCell cell1 = e.Item.Cells[0];
cell1.Text = cell1.Text + "期";
e.Item.Cells[1].Text = _Convert.ToHtmlCode(e.Item.Cells[1].Text);
e.Item.Cells[2].Text = "倍数:" + e.Item.Cells[2].Text;
double num = _Convert.StrToDouble(e.Item.Cells[3].Text, 0.0);
e.Item.Cells[3].Text = (num == 0.0) ? "" : num.ToString("N");
int num2 = _Convert.StrToInt(e.Item.Cells[7].Text, 0);
long num3 = _Convert.StrToLong(e.Item.Cells[9].Text, -1L);
switch (num2)
{
case 0:
if (num3 > 0L)
{
e.Item.Cells[4].Text = "<font color='#330099'>已成功</font>";
e.Item.Cells[5].Text = "<a href='Scheme.aspx?id=" + num3.ToString() + "' target='_blank'><font color=\"#330099\">查看方案</Font></a>";
return;
}
e.Item.Cells[4].Text = "<font color='Red'>进行中</font>";
((Button)e.Item.Cells[6].FindControl("btnQuashIsuse")).Enabled = true;
return;
case 2:
e.Item.Cells[4].Text = "系统撤单";
return;
default:
e.Item.Cells[4].Text = "用户撤消";
return;
}
}
}
示例12: g_ItemDataBound
protected void g_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem))
{
e.Item.Cells[1].Text = _Convert.StrToDouble(e.Item.Cells[1].Text, 0.0).ToString("N");
}
}
示例13: docGrid_ItemDataBound
protected void docGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
System.Web.UI.WebControls.LinkButton btnTplImg = (System.Web.UI.WebControls.LinkButton)e.Item.Cells[0].FindControl("btnImgTemplate");
string docFile = e.Item.Cells[0].Text;
if (docFile == " " || string.IsNullOrEmpty(docFile))
{
btnTplImg.Text = "<div class=\"hd-sp-img hd-sp-img-blank\" ></div>";
return;
}
switch (Path.GetExtension(docFile).ToLower())
{
case ".pdf":
case ".hpd":
case ".hfd":
// form template
btnTplImg.Text = "<div class=\"hd-sp-img hd-sp-img-frm\" ></div>";
break;
default:
// text template
btnTplImg.Text = "<div class=\"hd-sp-img hd-sp-img-txt\" ></div>";
break;
}
}
}
示例14: g_ItemDataBound
protected void g_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem))
{
double num = _Convert.StrToDouble((e.Item.Cells[2].FindControl("lblIn") as Label).Text, 0.0);
e.Item.Cells[2].Text = (num == 0.0) ? "" : num.ToString("N");
num = _Convert.StrToDouble((e.Item.Cells[3].FindControl("Label2") as Label).Text, 0.0);
e.Item.Cells[3].Text = (num == 0.0) ? "" : num.ToString("N");
num = _Convert.StrToDouble((e.Item.Cells[4].FindControl("Label3") as Label).Text, 0.0);
e.Item.Cells[4].Text = (num == 0.0) ? "" : num.ToString("N");
num = _Convert.StrToDouble((e.Item.Cells[5].FindControl("Label4") as Label).Text, 0.0);
e.Item.Cells[5].Text = (num == 0.0) ? "" : num.ToString("N");
num = _Convert.StrToDouble((e.Item.Cells[6].FindControl("Label5") as Label).Text, 0.0);
e.Item.Cells[6].Text = (num == 0.0) ? "" : num.ToString("N");
num = _Convert.StrToDouble((e.Item.Cells[7].FindControl("Label6") as Label).Text, 0.0);
e.Item.Cells[7].Text = (num == 0.0) ? "" : num.ToString("N");
long num2 = _Convert.StrToLong((e.Item.Cells[8].FindControl("Label7") as Label).Text, -1L);
if (num2 >= 0L)
{
(e.Item.Cells[1].FindControl("lblMemo") as Label).Text = "<a href='../Home/Room/Scheme.aspx?id=" + num2.ToString() + "' target='_blank'><font color=\"#330099\">" + (e.Item.Cells[1].FindControl("lblMemo") as Label).Text + "</Font></a>";
}
}
else if (e.Item.ItemType == ListItemType.Footer)
{
e.Item.Cells[0].ColumnSpan = 2;
e.Item.Cells.RemoveAt(8);
e.Item.Cells[0].Text = "合计";
e.Item.Cells[1].Text = PF.GetSumByColumn(this.ds.Tables[0], 3, false, 30, this.gPager.PageIndex).ToString("N");
e.Item.Cells[2].Text = PF.GetSumByColumn(this.ds.Tables[0], 4, false, 30, this.gPager.PageIndex).ToString("N");
e.Item.Cells[3].Text = PF.GetSumByColumn(this.ds.Tables[0], 5, false, 30, this.gPager.PageIndex).ToString("N");
e.Item.Cells[5].Text = PF.GetSumByColumn(this.ds.Tables[0], 7, false, 30, this.gPager.PageIndex).ToString("N");
e.Item.Cells[7].Visible = false;
}
}
示例15: grdEmpl_OnItemDataBound
public void grdEmpl_OnItemDataBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
TotalEngHours += Convert.ToDecimal(Convert.ToDecimal(e.Item.Cells[1].Text));
TotalFabHours += Convert.ToDecimal(Convert.ToDecimal(e.Item.Cells[2].Text));
TotalfinHours += Convert.ToDecimal(Convert.ToDecimal(e.Item.Cells[3].Text));
TotalMiscHours += Convert.ToDecimal(Convert.ToDecimal(e.Item.Cells[4].Text));
TotalHours += Convert.ToDecimal(Convert.ToDecimal(e.Item.Cells[5].Text));
TotalPrice += Convert.ToDecimal(Convert.ToDecimal(e.Item.Cells[6].Text));
}
else if (e.Item.ItemType == ListItemType.Footer)
{
e.Item.Cells[1].Text = TotalEngHours.ToString();
e.Item.Cells[1].Font.Bold = true;
e.Item.Cells[1].HorizontalAlign = HorizontalAlign.Left;
e.Item.Cells[2].Text = TotalFabHours.ToString();
e.Item.Cells[2].Font.Bold = true;
e.Item.Cells[2].HorizontalAlign = HorizontalAlign.Left;
e.Item.Cells[3].Text = TotalfinHours.ToString();
e.Item.Cells[3].Font.Bold = true;
e.Item.Cells[3].HorizontalAlign = HorizontalAlign.Left;
e.Item.Cells[4].Text = TotalMiscHours.ToString();
e.Item.Cells[4].Font.Bold = true;
e.Item.Cells[4].HorizontalAlign = HorizontalAlign.Left;
e.Item.Cells[5].Text = TotalHours.ToString();
e.Item.Cells[5].Font.Bold = true;
e.Item.Cells[5].HorizontalAlign = HorizontalAlign.Left;
e.Item.Cells[6].Text = TotalPrice.ToString();
e.Item.Cells[6].Font.Bold = true;
e.Item.Cells[6].HorizontalAlign = HorizontalAlign.Left;
}
}