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

Using Dock control in a WP fashion

3 Answers 29 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Massimiliano
Top achievements
Rank 1
Massimiliano asked on 12 Oct 2012, 11:03 AM
I was wondering if there is some "easy" workaround to obtain this... let me explain.
At the moment you place the "final" controls in docks and place docks in the zones in the page and save.
This way you have to work on the actual page and you should be able to save each control setting in each dock as well, let's say for example if you want to dispaly 4 or 8 or 16 news items in a news control.
I was wondering if it's possible to have a "fake" page (a sort of edit page and not the final rendered one) where you move docks placeholders of the real controls for the real page, and in each placeholder for the particular control you can edit that control settings. Then save everything so that when the real page is loaded all the docks, with controls and settings are loaded.
Written that way may seem complex but is exactly what you do with wordpress widgets. You drag and drop the kind of widget that you want (news, weather, whatever) inside zones (usually center or column) and then each widget that you dragged has settings for that particular control inside it. Then when you save you have the real page configured with widgets (docks) and controls.

3 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 17 Oct 2012, 07:28 AM
Hello Massimiliano,

You can use the online demo My Portal as a base and develop it further to achieve the desired functionality. The following steps could be useful for implementing a presentation mode and an edit mode for the widgets page:
  • When the page is editable the RadDocks will be draggable as configured in the demo and the configuratior for each widget will be visible (you can display it in the content of every dock) . In case the page is in display mode, you will  set the DragHandle property of every dock to None and DockMode to Docked. This way the docks will be positioned in the RadDockZones in which they have been placed in edit mode and it will not be possible to drag or press a command button.
  • By default the RadDockLayout persists the state only of the dock controls. If you make any changes to the content of the RadDocks, it will not be saved. Nevertheless, you can still implement this by creating additional fields in your datasource that will contain the configuration data for the widgets and saving or storing this data when the state of the docks is saved or loaded.

All the best,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Massimiliano
Top achievements
Rank 1
answered on 17 Oct 2012, 05:43 PM
Thank you Slav for your kind answer. Is ok that I have to persist each widget internal config by myself.
What I'm still missing is if it's possible to have an edit page (let's say MyEditPage.aspx) where you arrange all the docks wich may be just "representation" of the final widgets, just placeholders and then have the real display page (DisplayPage.aspx) where the real widgets are displayed based on your edit page config.
This is exactly what happens in WP and similar content management system, where you have an admin page where you arrange your layout and widget and then yoiu have the public page where the actual widget are displayed based on your admin edit page settings.

I hope this is more clear now.
Thanks in advance for your kind reply.
0
Slav
Telerik team
answered on 19 Oct 2012, 01:31 PM
Hello Massimiliano,

You can use the suggestions from my previous post and create separate pages for the two presentation modes. In the edit page you will not load the user controls with the widgets in the RadDocks. In the presentation page they will be loaded, the dragging functionality and the titlebar of the docks will be disabled. Note that both pages should use the same layout and IDs for RadDocks and RadDockZones in order to properly apply the dock state, saved from the edit page, to the presentation page.

Regards,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Dock
Asked by
Massimiliano
Top achievements
Rank 1
Answers by
Slav
Telerik team
Massimiliano
Top achievements
Rank 1
Share this question
or