Hi!
I created one parent webform with so many fields and one popup window(child form) with a GridView.
I want to fill the parent form with selected data in the GridView.
To do this, in parent window I have the following code:
In child form I have this code:
In GridvView_RowDa taBound I have:
When I execute this no error is occurs and no data is retrieved.
Please any one help me.
Please send me correct code for this and please tell me the wrong in my code.
please anyone help me.........
thanks in advance...
I created one parent webform with so many fields and one popup window(child form) with a GridView.
I want to fill the parent form with selected data in the GridView.
To do this, in parent window I have the following code:
Code:
<script type="text/javascript"> function GetValues() { window.open('search patient.aspx'); return false; } </script>
Code:
<script type="text/javascript"> var lastRowSelected; var originalColor; function GridView1_selectRow(row, Pat_Id) { if (lastRowSelected != row) { if (lastRowSelected != null) { lastRowSelected.style.backgroundColor = originalColor; lastRowSelected.style.color = 'Black' lastRowSelected.style.fontWeight = 'normal'; } originalColor = row.style.backgroundColor row.style.backgroundColor = 'BLUE' row.style.color = 'White' row.style.fontWeight = 'normal' lastRowSelected = row; } } function GridView1_mouseHover(row) { row.style.cursor = 'hand'; } function setRowNo(rowNo) { document.getElementById('hidRowNo').value = rowNo; } function returnValues() { if(document.getElementById('hidRowNo').value != "") { var rowNo = document.getElementById('hidRowNo').value; var grd = document.getElementById('GridView1'); //alert(grd.rows[rowNo].cells[0]); //alert(grd.rows[rowNo].cells[1]); window.opener.document.getElementById('patidtextbox').value = grd.rows[rowNo].cells[0].innerhtml; window.opener.document.getElementById('nametextbox').value = grd.rows[rowNo].cells[1].innerhtml; window.close(); } else { alert('Select any row from grid'); } } </script>
Code:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.ID = e.Row.Cells[0].Text; e.Row.Attributes.Add("onclick", "GridView1_selectRow(this,'" + e.Row.Cells[0].Text + "')+setRowNo(" + (e.Row.RowIndex + 1) + ")"); //e.Row.Attributes.Add("onclick1", "setRowNo(" + (e.Row.RowIndex + 1) + ");"); e.Row.Attributes.Add("onmouseover", "GridView1_mouseHover(this)"); } }
Please any one help me.
Please send me correct code for this and please tell me the wrong in my code.
please anyone help me.........
thanks in advance...
Comment