private void dgCostInputPri_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemIndex != -1) { string value = ((HtmlInputHidden)e.Item.FindControl("hidState")).Value; if (!value.Equals("1")) { e.Item.Attributes["onclick"] = "doClick(this,'" + this.dgCostInputPri.ClientID + "');" + string.Format("OnClickGridItem('{0}','{1}','{2}','{3}')", new object[] { e.Item.Cells[1].Text, e.Item.Cells[11].Text, e.Item.Cells[9].Text, e.Item.Cells[8].Text }); } else { e.Item.Attributes["onclick"] = "doClick(this,'" + this.dgCostInputPri.ClientID + "');" + string.Format("OnClickGridItem('{0}','{1}','{2}')", e.Item.Cells[1].Text, e.Item.Cells[11].Text, e.Item.Cells[9].Text); } e.Item.Cells[0].Text = Convert.ToString(e.Item.ItemIndex + 1); e.Item.Attributes["onmouseover"] = "doMouseOver(this);"; e.Item.Attributes["onmouseout"] = "doMouseOut(this)"; e.Item.Attributes["style"] = "cursor:hand"; e.Item.Cells[8].Text = AduitAction.SetOkState(e.Item.Cells[9].Text.ToString()).Substring(0, 3); string value2 = AduitAction.SetOkState(e.Item.Cells[9].Text.ToString()).Substring(3); e.Item.Cells[8].Style.Add("color", value2); } }
protected void GVApplication_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex > -1) { DataRowView dataRowView = (DataRowView)e.Row.DataItem; e.Row.Attributes["onmouseover"] = "OnMouseOverRecord(this);"; e.Row.Attributes["onclick"] = string.Concat(new string[] { "OnRecord(this);ClickRow('", dataRowView["RecordID"].ToString(), "','", dataRowView["AuditState"].ToString(), "');" }); e.Row.Cells[0].Text = Convert.ToString(e.Row.RowIndex + 1); userManageDb userManageDb = new userManageDb(); e.Row.Cells[1].Text = userManageDb.GetUserName(e.Row.Cells[1].Text); e.Row.Attributes["ondblclick"] = "OpenLock();"; e.Row.ToolTip = "双击查看详细信息"; string text; switch (text = e.Row.Cells[2].Text) { case "1": e.Row.Cells[2].Text = "事假"; break; case "2": e.Row.Cells[2].Text = "婚假"; break; case "3": e.Row.Cells[2].Text = "年休假"; break; case "4": e.Row.Cells[2].Text = "工伤"; break; case "5": e.Row.Cells[2].Text = "病假"; break; case "6": e.Row.Cells[2].Text = "产假"; break; case "7": e.Row.Cells[2].Text = "丧假"; break; } int num2 = AduitAction.SetOkState(dataRowView["AuditState"].ToString()).LastIndexOf('#'); e.Row.Cells[8].Text = AduitAction.SetOkState(dataRowView["AuditState"].ToString()).Substring(0, num2); string value = AduitAction.SetOkState(dataRowView["AuditState"].ToString()).Substring(num2); e.Row.Cells[8].Style.Add("color", value); } }
protected void GVInOutMain_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex > -1) { DataRowView dataRowView = (DataRowView)e.Row.DataItem; e.Row.Attributes["onmouseover"] = "OnMouseOverRecord(this);"; e.Row.Attributes["onclick"] = string.Concat(new object[] { "OnRecord(this);ClickRow('", dataRowView["RecordID"].ToString(), "','", dataRowView["AuditState"].ToString(), "','", dataRowView["SystemName"], "');" }); e.Row.Cells[0].Text = Convert.ToString(e.Row.RowIndex + 1); string value = AduitAction.SetOkState(dataRowView["AuditState"].ToString()).Substring(3); e.Row.Cells[4].Style.Add("color", value); e.Row.Cells[4].Text = AduitAction.SetOkState(dataRowView["AuditState"].ToString()).Substring(0, 3); e.Row.Cells[5].Text = ((dataRowView["IsCurrent"].ToString() == "1") ? "是" : "否"); HyperLink hyperLink = (HyperLink)e.Row.Cells[1].Controls[0]; hyperLink.NavigateUrl = "#"; hyperLink.NavigateUrl = string.Concat(new object[] { "javascript:void(window.open('SystemInfoAdd.aspx?t=View&rid=", dataRowView["RecordID"].ToString(), "&cd=", this.ClassID, "&ctc=", base.Request["ctc"].ToString(), "','','left=150,top=150,width=500,height=250,toolbar=no,status=yes,scrollbars=yes,resizable=no'));" }); e.Row.Attributes["onDblClick"] = string.Concat(new object[] { "return openEdit('View','", this.ClassID, "','", base.Request["ctc"].ToString(), "');" }); this.GVInOutMain.ToolTip = "请双击查看详细信息"; } }
private void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemIndex != -1) { e.Item.Attributes["id"] = e.Item.ItemIndex.ToString(); e.Item.Attributes["onclick"] = string.Concat(new string[] { "OnRecord(this);setvalue('", e.Item.Cells[0].Text, "',", e.Item.Cells[9].Text, ")" }); e.Item.Attributes["onmouseover"] = "OnMouseOverRecord(this)"; e.Item.Attributes.Add("ondblclick", "ShowInfo(); return false;"); e.Item.ToolTip = "双击查看详细信息"; string value = AduitAction.SetOkState(e.Item.Cells[9].Text).Substring(3); e.Item.Cells[8].Style.Add("color", value); e.Item.Cells[8].Text = AduitAction.SetOkState(e.Item.Cells[9].Text).Substring(0, 3); HyperLink hyperLink = (HyperLink)e.Item.Cells[3].Controls[0]; hyperLink.NavigateUrl = "#"; hyperLink.NavigateUrl = "javascript:void(window.open('SuperviseManage.aspx?pk=" + e.Item.Cells[0].Text + "&readonly=','','left=150,top=150,width=640,height=580,toolbar=no,status=yes,scrollbars=yes,resiz able=no'));"; } }