日期:2014-05-17 浏览次数:20434 次
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow ) { Label lb=e.Row.FindControl("lbName") as Label; e.Row.Cells[1].Attributes.Add("onclick ", " window.returnValue='" + lb.Text.Trim() + "';window.close();"); } } protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { GridView1.EditIndex = e.NewEditIndex; bind(); }
<script type="text/javascript"> function chose() { var hdc = window.showModalDialog("bunit.aspx", "newwindow", "resizable:no;scroll:yes;status:no;dialogLeft=380px;dialogTop=500px;dialogWidth=300px;dialogHeight=250px;center=no;help=no"); document.getElementById("<%=GridView1.ClientID%>").rows[document.getElementById("<%=GridView1.ClientID%>").rows.length - 1].getElementsByTagName("input")[3].value = hdc; }
if (e.Row.RowType == DataControlRowType.DataRow && GridView1.EditIndex==-1)