Expandable Rows on the Gridview

Does anyone have any idea how each row in the Gridview is expanded to show a DIV or PANEL that is in the form of items, i.e. simple form of text boxes, etc. I don't need a nested Gridview showing the results or using DynamicPopulate.

I've tried some of the methods from the expandable DataGrid row but ran into some problems trying to access variables that just aren't part of the Gridview. Any help would be greatly appreciated. I could do this with Editable Templates in Gridview, but I need a much cleaner solution.

+1


source to share


7 replies


I was able to do this successfully by injecting a div into a div below each grid created. Once there, I was able to provide them with unique IDs based on the data I was using, call the expand function in javascript, and expand / collapse the divs as I see fit.

This is fairly doable with a gridview, but a relayer will work as well, as well as a simple AJAX implementation returning the table structure.



Here's a very similar example of what I did:

http://www.codeproject.com/KB/ajax/ExpandPanelGridView.aspx?display=Print

+1


source


I've done something similar lately with the ASP.NET ListView control - you have more control over the generated markup than with the standard Gridview.



Check out this post from Matt Berset.

+1


source


If you can afford it, there are many gridview controls that are ajaxified and have the ability to expand each row as needed. I am using one set of controls from the company that will remain unnamed (for now) and have been very happy with them.

Do a google search on the gridview controls.

0


source


I have a solution where I created an additional Gridview Row and then insert a Panel on that row with my items. The problem is my CLOSE image keeps disappearing.

0


source


Probably inelegant, but I did it by replacing the gridview with a repeater. It still looks like a gridview, but after each row of data, I add an extra row containing an invisible subgrid that can be shown with javascript. Obviously, you would replace the sub-segment with your panel. A bit fake, but it works fine.

0


source


0


source


The GridView is terrible for this kind of funcctionality because it is in control of its UI. ListView is great for implementing this.

0


source







All Articles