Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

dynamic creation of CollapsiblePanel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jmgopi@gmail.com - 03 Apr 2007 02:27 GMT
Hi:

Can somebody provide me samples on how to create a dynamic
CollapsiblePanel using ASP.NET AJAX Toolkit. Any points are highly
appreciated.

Thanks,
GJM
Ben Rush - 03 Apr 2007 03:33 GMT
Sure. But can you be more specific about what you mean by dynamic, please? I
want to make sure I understand what you're saying...

Signature

~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog

> Hi:
>
[quoted text clipped - 4 lines]
> Thanks,
> GJM
Jeff B. - 11 Jun 2007 02:43 GMT
Here is what I use to create a collapsible panel dynamically.  It's a function that takes in two other asp panels--one for the header and one for the content. the only thing this function needs knowledge of is the ID of the button used for the ImageControlID.  You can probably do something to make it totally dynamic by looking through the controls in the header panel for an image control matching a pattern on the name.

The return from this function needs to be added to another panel that exists on the page.

private AjaxControlToolkit.CollapsiblePanelExtender PopulateCollapsiblePanel(Panel headerPanel, Panel bodyPanel)
   {
       collapsiblePan = new CollapsiblePanelExtender();
       collapsiblePan.ExpandControlID = headerPanel.UniqueID;
       collapsiblePan.CollapseControlID = headerPanel.UniqueID;
       collapsiblePan.TargetControlID = bodyPanel.UniqueID;
       collapsiblePan.Collapsed = false;
       collapsiblePan.ID = "collapsiblePan";
       collapsiblePan.ExpandedText = "Click to Collapse";
       collapsiblePan.CollapsedText = "Click to Expand";
       collapsiblePan.ImageControlID = "controlBtn";
       collapsiblePan.ExpandedImage = "~/images/collapse_blue.jpg";
       collapsiblePan.CollapsedImage = "~/images/expand_blue.jpg";
       collapsiblePan.EnableViewState = true;
       //collapsiblePan.SuppressPostBack = true;
       collapsiblePan.EnableClientState = true;
       return collapsiblePan;
   

From http://www.developmentnow.com/g/8_2007_4_0_0_953045/dynamic-creation-of-Collapsi
blePanel.ht


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.