protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
{
//鼠标移动到每项时颜色交替效果
e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';this.style.color='#000000'");
e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#dcdcdc';this.style.color='#8C4510'");
//设置悬浮鼠标指针形状为"小手"
e.Row.Attributes["style"] = "Cursor:hand";
}
//行点击事件(传参)
Label LB_FRMID = (Label)e.Row.Cells[6].FindControl("FRMID");
string FRMID = LB_FRMID.Text.ToString().Trim();
Label LB_GATE = (Label)e.Row.Cells[7].FindControl("GATE");
string GATE = LB_GATE.Text.ToString().Trim();
//连接路径
Label FRMNO = (Label)e.Row.Cells[5].FindControl("FRMNO");
if (myData.GetFrmPath(FRMNO.Text.ToString().Trim()).Tables[0].Rows.Count != 0)
{
string FrmPath1 = myData.GetFrmPath(FRMNO.Text.ToString().Trim()).Tables[0].Rows[0]["FRMKD"].ToString();
string FrmPath2 = FRMNO.Text;
string FrmPath3 = myData.GetFrmPath(FRMNO.Text.ToString().Trim()).Tables[0].Rows[0]["FILENAME"].ToString();
string conna = System.Configuration.ConfigurationManager.AppSettings["FrmStrg"];
string FrmPath = conna + FrmPath1 + "/" + FrmPath2 + "/" + FrmPath3;
string FRMTB = myData.GetFrmPath(FRMNO.Text.ToString().Trim()).Tables[0].Rows[0]["FRMTB"].ToString();//取table名
for (int i = 0; i <= 3; i++)
{
e.Row.Cells[i].Attributes.Add("onclick", string.Format("location.href='{0}'", "" + FrmPath + "?FRMID=" + FRMID + "&GATE=X&FRMTB=" + FRMTB + ""));
}
//e.Row.Cells[4].Attributes.Add("onclick", string.Format("location.href='{0}'", "GoReturn.aspx?FRMID=" + FRMID + "&GATE=X&FRMTB=" + FRMTB + ""));
e.Row.Cells[4].Attributes.Add("onclick", "javascript:OpenEditWin('GoReturn.aspx?FRMID=" + FRMID + "&FRMNO=" + FrmPath2 + "&FRMTB=" + FRMTB + "',700,500)");
}
}
}