Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 780
  • Last Modified:

Nested gridview paging causes the div section to close

Dear All,

I have two gridviews one within each other.

I have applied paging to the outer and the inner gridview but am facing a little dilema.
When i page through the nested gridview the gidview collapses.

I have put the nested gridview within a div tag which through javascript opens and closes the div to hide / show the gridview when clicking over the outer gridview row.

I followed the following example to help me produce my page.
http://www.aspboy.com/Categories/GridArticles/Hierarchical_GridView_With_Clickable_Rows.aspx

I even thought of putting the entire body of the page within an update panel, but no joy.
the javascript is
 <script language="JavaScript" type="text/javascript">
 
var currentlyOpenedDiv="";
 
function CollapseExpand(object)
 
{
 
        var div=document.getElementById(object);
 
        if(currentlyOpenedDiv!="" && currentlyOpenedDiv!=div)
 
        {
 
                currentlyOpenedDiv.style.display="none";
 
        }
 
        if(div.style.display=="none")
 
        {
 
                div.style.display="inline";
 
                currentlyOpenedDiv=div;
 
        }
 
        else
 
        {
 
                div.style.display="none";
 
        }
 
}
 
</script>

Open in new window

0
ddl_ex5
Asked:
ddl_ex5
2 Solutions
 
prashantagarw10Commented:
put a javascript alert whenver you are collapsing or expanding the inner grid's div thru javascript.
This will give you an idea of what is happening in the page load after the paging link is clicked by user.
Let me know the observation so that i can assist you further on this!

Cheers!
Prashant
0
 
ddl_ex5Author Commented:
i decided that i would just bring back all the records and put the inner gridview into a panel with scrolling bars. it is not ideal but a quick fix.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now