Click here to Skip to main content
15,742,180 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have two asp.net gridviews in master/detail configuration. I expand a master row to display the child rows and do manipulations on the child rows such as select the row and show a color and open a popup on selected row. After that I want the parent gridview to Expand both the gridviews to refresh with new data. Please let me know how could I do it. iam writing some code please check it...

<script lang="javascript" type="text/javascript">
function divexpandcollapse(divname) {
var div = document.getElementById(divname);
var img = document.getElementById('img' + divname);
if (div.style.display == "none") {
div.style.display = "block";
}
else {
div.style.display = "none";
img.src = "images/ag.png";
}
}
</script>

<body>
<form id="form1" runat="server">

<asp:ScriptManager ID="scm" runat="server">
<asp:UpdatePanel ID="grv_up" runat="server">
<contenttemplate>
<asp:Panel ID="grv_Panel" runat="server">

   
  <asp:Label ID="lbl_Result" runat="server" Font-Bold="True" ForeColor="Red">
<asp:GridView ID="grv_EHRMedications" runat="server" Width="100%"
AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333"
GridLines="None" OnRowDataBound="grv_EHRMedications_RowDataBound" ShowHeader="false">
<alternatingrowstyle backcolor="White" forecolor="#284775">
<columns> <asp:TemplateField >
<itemtemplate>

<img id='imgdiv<%# Eval("MEDICINEREFID") %>' src="images/ag.png" />


<itemstyle width="20px">

<asp:BoundField DataField="MEDICINEREFID" Visible="true"/>
<asp:BoundField DataField="CURRENTDATE" HeaderText="DATE" Visible="true"/>
<asp:TemplateField HeaderText="Items" Visible="True">
<itemtemplate>
<asp:Label ID="lblItems" runat="server">



<asp:TemplateField>
<itemtemplate>

<asp:Panel ID="ChildGrid" runat="server">

Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900