在父页面中添加JS代码:
<script type="text/javascript" language="javascript">
$(document).ready(function () {
setGridScroll('<%= grvArea.ClientID %>', '80');
new superTable('<%= grvArea.ClientID %>', {
cssSkin: "sSky",
headerRows: 1
});
});
//
function showModal(type) {
var obj = new Object();
obj.type = type;
var sdate = $get('<%= Sdate.ClientID %>').value;
var edate = $get('<%= Edate.ClientID %>').value
var colname = $get('<%= MemType.ClientID %>').value;
var uid = window.showModalDialog("CustomListView.aspx?rowId=" + type + "&Type=View&Sdate=" + sdate+"&EDate="+ edate +"&txtype="+ colname, obj, "dialogHeight:500px;dialogWidth:1200px;center:1;help:0;scroll:yes;location:no;status:yes");
}
</script>
.CS里面:
protected void grvArea_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
SetGridCellId(grvArea, e.Row, "PkId", "id");
e.Row.Attributes["ondblclick"] = "dblClick(this,'" + GetFromUrl() + "');";
//e.Row.Cells[1].Attributes["onclick"] = "showModal('" + DataBinder.Eval(e.Row.DataItem, "PkId").ToString() + "');";
//e.Row.Cells[1].Text = "<a href='#'>" + DataBinder.Eval(e.Row.DataItem, "CustomId").ToString() + "</a>";
e.Row.Cells[1].Attributes["onclick"] = "showModal('" + DataBinder.Eval(e.Row.DataItem, "type").ToString() + "');";
e.Row.Cells[1].Text = "<a href='#'>" + DataBinder.Eval(e.Row.DataItem, "count").ToString() + "</a>";
//e.Row.Cells[1].Text = "<a href='#'>" + DataBinder.Eval(e.Row.DataItem, "type").ToString() + "</a>";
//string type1 = DataBinder.Eval(e.Row.DataItem, "type").ToString();
//Session["type1"] = type1;
}
//if (e.Row.RowType == DataControlRowType.Header)
//{
//}
//if (e.Row.RowType == DataControlRowType.DataRow)
//{
// e.Row.Cells[0].Text = (e.Row.RowIndex + 1).ToString();
// e.Row.Attributes["onclick"] = "selectrow(this);SavePkId(this);";
// // e.Row.Attributes["ondblclick"] = "dblClick(this,'" + GetFromUrl() + "');";
// SetGridCellId(grvArea, e.Row, "type", "type");
// SetGridCellId(grvArea, e.Row, "count", "count");
// //SetGridCellId(grvArea, e.Row, "Mpkid", "mpkid");
// //SetGridCellId(grvArea, e.Row, "qc", "qc");
// try
// {
// total1 += Convert.ToDecimal(e.Row.Cells[8].Text);
// total2 += Convert.ToDecimal(e.Row.Cells[9].Text);
// total3 += Convert.ToDecimal(e.Row.Cells[10].Text);
// }
// catch { }
//}
//if (e.Row.RowType == DataControlRowType.Footer)
//{
// e.Row.Cells[8].Text = total1.ToString();
// e.Row.Cells[9].Text = total2.ToString();
// e.Row.Cells[10].Text = total3.ToString();
//}
}
弹出信息窗口:
//获?取?type的?值μ...............
string type = QueryString("txtype");
dict.Add("@type", type);