Solved

Nested gridview paging causes the div section to close

Posted on 2009-07-01
2
696 Views
Last Modified: 2012-05-07
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
Comment
Question by:ddl_ex5
2 Comments
 
LVL 5

Assisted Solution

by:prashantagarw10
prashantagarw10 earned 20 total points
Comment Utility
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
 

Accepted Solution

by:
ddl_ex5 earned 0 total points
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video discusses moving either the default database or any database to a new volume.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now