Jake
Jake

Reputation: 115

Collapsible gridview columns

Tricky question...I'd really appreciate some help.

I have a gridview with 38 columns. The first three should always be around. The rest should be collapsible in sets of 7 (e.g columns 4-10 should collapse as a unit, 11-17, etc.)

I have found the AJAX Toolkit CollapsiblePanelExtender and it is fantastic. However, it runs off panels, which I don't think I can separate columns into, can I?

Here is the Ajax code:

             <AjaxToolKit:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" TargetControlID="PanelZone1" ExpandControlID="panelZone1" CollapseControlID="PanelZone1" Collapsed="false" AutoCollapse="true" AutoExpand="true">
            </AjaxToolKit:CollapsiblePanelExtender>

Is there any way to specify sets of columns as panels for this?

Or is there a better way to try to do this?

Thank you so much for your help!

Upvotes: 0

Views: 1335

Answers (2)

Robert
Robert

Reputation: 112

Have you thought about a nested GridView? You can display some of your columns in the main GridView, then open the Collapsible panel to reveal another GridView with the rest of the columns?

I'm working on a complex system now with a GridView with a Collapsible panel that opens to a Repeater with (you guessed it) ANOTHER Collapsible panel with another repeater inside that. Kinda like this:

GridView
--Collapsible Panel 1
----Repeater 1
------- Collapsible Panel 2
---------- Repeater 2

Upvotes: 0

Use the showColumn and hideColumn client-side methods to show/hide columns from the Grid. Use the Index or the DataField of the column as the parameter for these methods. Hope it helps you.

Upvotes: 1

Related Questions