This is a migrated thread and some comments may be shown as answers.

RadDock, removing items from RadDockLayout in code behind

2 Answers 126 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 23 Sep 2008, 02:56 PM
Hi,

We are trying to create a solution with a large number of categorized RadDocks. For example it might comprise of 10 categories, each with 10-20 Docks

We currently have the following setup:

A RadDockLayout with Two RadDockZones

<RadDockLayout>
  <RadDockZone1>
    <DropDownList>Category List</DropDownList>
    A number of RadDocks to select from
  </RadDockZone1>
  <RadDockZone2>
    The RadDocks a user would like to have saved in their profile
  </RadDockZone2>
</RadDockLayout>

The top RadDock Zone is populated on Page Load with a number of minimized RadDocks from the first category, the Raddocks can be dragged to the second RadDockZone.

This works perfectly, the layout is saved on postback, and we can save the Layout of RadDockZone2 to the database.

The problem is that when we select a new Category from the list, we would like all of the Docks in RadDockZone1 to be removed, and show only the Docks from the newly selected category. (While maintaining the selection in RadDockZone2)

This seems to be causing a conflict somewhere, I have tried the following:

- Removing the unnecessary RadDocks from the CurrentDockStates collection (in RadComboBox1_SelectedIndexChanged)
- Clearing the DockZOne with RadDockZone1.Docks.Clear (in RadComboBox1_SelectedIndexChanged)

Could you point me in the right direction to achieve something like this?

2 Answers, 1 is accepted

Sort by
0
Petko
Telerik team
answered on 25 Sep 2008, 12:23 PM
Hello Marcel,

Thank you for contacting us.
We created a sample page which demonstrates a scenario similar to the one you describe. We have added some comments to help you better understand the suggested idea. Please, find the example attached.
The enclosed example is similar to the Dynamically Create Docks online example instead of some small modifications which make it answer the requirements of your scenario.
Our suggestion is to use the RadDock's Closed property for closing the dock which you do not need to be displayed. In this way you can recreate all of the previously existing docks as well as the newly added ones for the selected category and close the old docks which are located in the first RadDockZone so that only the need docks will be visible on the page.  
If you need further assistance, do contact us again.

Best regards,
Petko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Marcel
Top achievements
Rank 1
answered on 25 Sep 2008, 12:56 PM
Thanks Petko! that's exactly what I was looking for. Stupid of me not to think of using 'close'....
Tags
Dock
Asked by
Marcel
Top achievements
Rank 1
Answers by
Petko
Telerik team
Marcel
Top achievements
Rank 1
Share this question
or