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

Some my problems with RadDock

5 Answers 159 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Red
Top achievements
Rank 1
Red asked on 18 Apr 2008, 04:32 AM
Sorry if my English is not good

When I used RadDock in my project. I have some problem and I don't know what to do. I read some posts here and haven't found what I need yet.

My problems:

- When I clicked Hide symbol ,  the Dock hided. But when I want to show it, it doesn't show the full size.
       Example. First, My DockManager and My DockPanel have size width 200.
    I also set minimum width size 200, but when I hided it and show again, its width approximate 50 and some of my controls doesn't show.
    I can resize the DockPanel in this circumstance but it's not comfortable

- When I set Property Allow Hiding to True in DockManager. Sometimes User can click Hided, but how can I show it again ? I set DockManager visible true but it doesn't work. I think I did wrong way but what I have to do ?

- I doesn't want user to Float, Resize, or Close my DockManager. My application have a table to display results. But input parameters may be diffirent. So I want to add those input to DockManager and TabDocument.

When I want to work full-screen, I can Hided the Dock.Then if I want to work with new result, I show the Dock, choose Tab I want .

So I don't want User to Float, Resize, Close my Dock. What must I have ?

Sorry for asking too much. But I can't read all the post here because they're not sorted into groupped so finding the information I need is difficult

5 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 18 Apr 2008, 09:26 AM
Hi Red,

Thank you for writing.

You can use the Hide and Show methods of IDockable window such as DockPanel to hide/show a window unchanged and save size before hide operation. The operation is different from SetDock, which re-docks the window with a new size depending on the current layout of the DockingManager.

To disable the global dock operation you can use the following properties:
  • AllowFloating
  • AllowDocking
  • AllowHiding
  • AllowDrag

Also, you can show/hide the system menu and the buttons of ToolWindows and Document container.
For ToolWindow type of windows (DockPanel, UserDockControl) the properties are:

  • CaptionVisible
  • TabStripVisible
  • CloseButronVisible
  • HideButtonVisible
  • DropDownButtonVisible

The controller for TabbedDocument windows is located in DockingManager:

  • TdiContextMenuVisible
  • TdiActiveMenuVisible
  • TdiCloseButtonVisible
  • TdiContainerVisible

 I hope this helps. If you have additional questions, please contact me.

Greetings,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Golu
Top achievements
Rank 1
answered on 18 May 2009, 04:29 AM
Dear sir,

One question is ...how can I use (install) DockManager.
should I  use any dll? I am trying to add "RadDock.Net2.dll" in assembly but not added (working, may be some other file is missing).

accoding to use application I would like to load user controls in dock dynamically and when hide any dock after show also...
how is it possible. still I am using DockLayout-->DockZone-->dock process, but after read some atricles got that If I am useing DockManager then its best to solve all the quries..
I am right?

thanks with regards
0
Petio Petkov
Telerik team
answered on 18 May 2009, 10:03 AM
Hi Neha,

Our suggestion for all new development is to use RadDock for ASP.NET AJAX, which is built on top of ASP.NET AJAX. All our new development is concentrated on RadDock for ASP.NET AJAX and most of bugs related to RadDock for ASP.NET are fixed in it. Also we stopped the RadDock for ASP.NET development.
A simple example which illustrates how to add dynamically created RadDocks via AJAX and save their state in the Session on each move(dock,expand,collapse and close)is available here:
http://demos.telerik.com/aspnet-ajax/dock/examples/myportal/defaultcs.aspx
In the example above once you close a RadDock it is removed and it will not be recreated anymore. You can modify the example to recreate the closed RadDocks and once you need them you could show them via JavaScript. 
If you have problems implementing your scenario, please explain your goals in more details and we will do our best to help you.


Greetings,
Petio Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Golu
Top achievements
Rank 1
answered on 19 May 2009, 10:40 AM

Dear sir,
on Save button click i have save dockstates in database, and whether it move etc use session, when explictly save than current page states saved in database.(I am creating a dashboard).
and once user control loaded then not again.
I have done all these funcationing but not satisfied, and speed is also very slow..
I am sending you my code plz check it where I am missing somethng?

 
Aspx...

 

<

 

table width="100%" border="0" cellpadding="1" cellspacing="0" class="aspxMainTable">

 

 

 

 

 

<tr>

 

 

 

 

 

<th class="tdMainHeader1">

 

 

 

 

 

<img alt="Customer" src="Images/dashboard.gif" />

 

 

 

 

Dashboard

&nbsp;&nbsp;&nbsp; Objects &nbsp;

 

 

 

 

 

<telerik:RadComboBox ID="cmbSelectDock" runat="server" Skin="Office2007">

 

 

 

 

 

<Items>

 

 

 

 

 

<telerik:RadComboBoxItem Text="Case Summary" Value="CaseSummary" />

 

 

 

 

 

<telerik:RadComboBoxItem Text="Task Summary" Value="TaskSummary" />

 

 

 

 

 

<telerik:RadComboBoxItem Text="Pending Tasks" Value="MyTask" />

 

 

 

 

 

<telerik:RadComboBoxItem Text="Pending Cases" Value="MyCase" />

 

 

 

 

 

<telerik:RadComboBoxItem Text="Overdue Cases" Value="OverdueCases" />

 

 

 

 

 

</Items>

 

 

 

 

 

</telerik:RadComboBox>

 

 

 

 

 

&nbsp;

 

 

 

 

 

<telerik:RadComboBox ID="cmbZone" runat="server" Skin="Office2007" DataSource="<%#GetZones() %>"

 

 

 

 

 

DataTextField="ID" DataValueField="ClientID">

 

 

 

 

 

</telerik:RadComboBox>

 

 

 

 

 

&nbsp;

 

 

 

 

 

<asp:Button ID="btnAddDock" runat="server" Text="Add" Width="100px" OnClientClick="return ValidateSave();"

 

 

 

 

 

OnClick="btnAddDock_Click" />

 

 

 

 

 

&nbsp;

 

 

 

 

 

<asp:Button ID="btnSaveDock" runat="server" Text="Save" Width="100px" OnClick="btnSaveDock_Click" />

 

 

 

 

 

</th>

 

 

 

 

 

</tr>

 

 

 

 

 

<tr>

 

 

 

 

 

<td colspan="5">

 

 

 

 

 

<asp:UpdatePanel runat="server" ID="UpdatePanel2">

 

 

 

 

 

<ContentTemplate>

 

 

 

 

 

<telerik:RadDockLayout runat="server" ID="rdDockLayout" OnSaveDockLayout="rdDockLayout_SaveDockLayout"

 

 

 

 

 

Skin="Office2007" OnLoadDockLayout="rdDockLayout_LoadDockLayout">

 

 

 

 

 

<table id="TableLayout" width="100%">

 

 

 

 

 

<tr>

 

 

 

 

 

<td style="width: 50%;" align="left" valign="top">

 

 

 

 

 

<table width="100%" border="0">

 

 

 

 

 

<tr>

 

 

 

 

 

<td>

 

 

 

 

 

<telerik:RadDockZone runat="server" ID="RadDockZone1"

 

 

Width="380" MinHeight="250"

 

 

 

 

 

Orientation="Vertical" Style="background: #f5f4e8; float: left;" Skin="Office2007"

 

 

 

 

 

FitDocks="true">

 

 

 

 

 

</telerik:RadDockZone>

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

</table>

 

 

 

 

 

</td>

 

 

 

 

 

<td style="width: 50%;" align="left" valign="top">

 

 

 

 

 

<table width="100%" border="0">

 

 

 

 

 

<tr>

 

 

 

 

 

<td>

 

 

 

 

 

<telerik:RadDockZone runat="server" ID="RadDockZone2" Width="380" MinHeight="250"

 

 

 

 

 

Orientation="Vertical" Style="background: #d5f0fa; float: left;" FitDocks="true"

 

 

 

 

 

Skin="Office2007">

 

 

 

 

 

</telerik:RadDockZone>

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

</table>

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

</table>

 

 

 

 

 

</telerik:RadDockLayout>

 

 

 

 

 

</ContentTemplate>

 

 

 

 

 

<Triggers>

 

 

 

 

 

<asp:AsyncPostBackTrigger ControlID="btnAddDock" EventName="Click" />

 

 

 

 

 

</Triggers>

 

 

 

 

 

</asp:UpdatePanel>

 

 

 

 

 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

 

 

 

 

 

</asp:UpdatePanel>

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

<tr>

 

 

 

 

 

<td>

 

 

 

 

 

<asp:Label ID="lblMessage" runat="server"></asp:Label>

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

</table>


aspx.cs

 

public

 

partial class TestPage_Neha : ThemeBase

 

 

 

 

{

 

private int _count = 0;

 

 

int i = 0;

 

 

string dockState = "";

 

 

string strDockTag = string.Empty;

 

 

 

DockStateWS objDockStateWS;

 

 

DataSet dsDataSet;

 

 

List<DockState> stateList;

 

 

StringBuilder serializedList = new StringBuilder();

 

 

private List<DockState> CurrentDockStates

 

{

 

get

 

 

 

 

{

 

List<DockState> _currentDockStates = (List<DockState>)Session["CurrentDockStatesMyPortal"];

 

 

if (Object.Equals(_currentDockStates, null))

 

{

_currentDockStates =

new List<DockState>();

 

Session[

"CurrentDockStatesMyPortal"] = _currentDockStates;

 

}

 

return _currentDockStates;

 

}

 

set

 

 

 

 

{

Session[

"CurrentDockStatesMyPortal"] = value;

 

}

}

 

 

public ArrayList GetZones()

 

{

 

ArrayList zones = new ArrayList();

 

zones.Add(RadDockZone1);

zones.Add(RadDockZone2);

 

return zones;

 

}

 

protected void Page_InIt(object sender, EventArgs e)

 

{

 

for (int i = 0; i < CurrentDockStates.Count; i++)

 

{

 

if (CurrentDockStates[i].Closed == false)

 

{

 

RadDock dock = CreateRadDockFromState(CurrentDockStates[i]);

 

rdDockLayout.Controls.Add(dock);

CreateSaveStateTrigger(dock);

LoadWidget(dock);

}

}

 

}

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

 

 

 

 

 

if (!Page.IsPostBack)

 

{

cmbZone.DataBind();

 

//-- from database

 

 

 

 

 

try

 

 

 

 

{

objDockStateWS =

new DockStateWS();

 

dsDataSet = objDockStateWS.Fetch_Dock_State(0, 2);

 

if (dsDataSet.Tables["DockState"].Rows.Count > 0)

 

{

dockState =

Convert.ToString(dsDataSet.Tables["DockState"].Rows[0]["dock_state"]);

 

 

string[] currentDockStates = dockState.Split('|');

 

_count = currentDockStates.Length;

 

for (int i = 0; i < _count; i++)

 

{

 

if (currentDockStates[i].Trim() != string.Empty)

 

{

 

 

 

 

 

 

System.Web.Script.Serialization.

JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

 

 

DockState state = serializer.Deserialize<DockState>(currentDockStates[i]);

 

 

RadDock dock = CreateRadDockFromState(state);

 

rdDockLayout.Controls.Add(dock);

CreateSaveStateTrigger(dock);

LoadWidget(dock);

}

}

}

}

 

catch (Exception ex)

 

{

 

ScriptManager.RegisterStartupScript(Page, Page.GetType(), "errMsg", "javascript:alert(\"Error:-Method -> 'Page_Init' \\n Description:- \\n" + ex.Message + "\");", true);

 

 

return;

 

}

}

}

 

protected void rdDockLayout_LoadDockLayout(object sender, DockLayoutEventArgs e)

 

{

 

//--use session

 

 

 

 

 

foreach (DockState state in CurrentDockStates)

 

{

e.Positions[state.UniqueName] = state.DockZoneID;

e.Indices[state.UniqueName] = state.Index;

}

 

//--from database

 

 

 

 

 

DataTable dt = new DataTable();

 

System.Web.Script.Serialization.

JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

 

 

 

try

 

 

 

 

{

objDockStateWS =

new DockStateWS();

 

dsDataSet =

new DataSet();

 

dsDataSet = objDockStateWS.Fetch_Dock_State(0, 2);

 

if (dsDataSet.Tables["DockState"].Rows.Count > 0)

 

{

dockState =

Convert.ToString(dsDataSet.Tables["DockState"].Rows[0]["dock_state"]);

 

 

string[] currentDockStates = dockState.Split('|');

 

 

foreach (string stringState in currentDockStates)

 

{

 

if (stringState.Trim() != string.Empty)

 

{

 

DockState state = serializer.Deserialize<DockState>(stringState);

 

e.Positions[state.UniqueName] = state.DockZoneID;

e.Indices[state.UniqueName] = state.Index;

}

}

}

}

 

catch (Exception ex)

 

{

LogMessage(ex, 1);

}

}

 

protected void rdDockLayout_SaveDockLayout(object sender, DockLayoutEventArgs e)

 

{

 

//--use session

 

 

 

 

CurrentDockStates = rdDockLayout.GetRegisteredDocksState();

}

 

private RadDock CreateRadDockFromState(DockState state)

 

{

 

RadDock dock = new RadDock();

 

dock.ID =

string.Format("RadDock{0}", state.UniqueName);

 

dock.ApplyState(state);

dock.Command +=

new DockCommandEventHandler(dock_Command);

 

dock.Commands.Add(

new DockCloseCommand());

 

dock.Commands.Add(

new DockExpandCollapseCommand());

 

 

return dock;

 

}

 

 

 

 

void dock_Command(object sender, DockCommandEventArgs e)

 

{

 

if (e.Command.Name == "Close")

 

{

 

ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "RemoveDock", string.Format(@"function _removeDock() {{ Sys.Application.remove_load(_removeDock);$find('{0}').undock(); $get('{1}').appendChild($get('{0}')); $find('{0}').doPostBack('DockPositionChanged');}};Sys.Application.add_load(_removeDock);", ((RadDock)sender).ClientID, UpdatePanel1.ClientID), true);

 

}

if (e.Command.Name == "Close")

 

{

 

ScriptManager.RegisterStartupScript(

 

UpdatePanel1,

 

this.GetType(),

 

 

"RemoveDock",

 

 

string.Format(@"function _removeDock() {{

 

Sys.Application.remove_load(_removeDock);

$find('{0}').undock();

$get('{1}').appendChild($get('{0}'));

$find('{0}').doPostBack('DockPositionChanged');

}};

Sys.Application.add_load(_removeDock);"

 

, ((RadDock)sender).ClientID, UpdatePanel1.ClientID),

 

 

true);

 

}

}

 

private RadDock CreateRadDock()

 

{

 

int docksCount = CurrentDockStates.Count;

 

 

RadDock dock = new RadDock();

 

dock.UniqueName =

Guid.NewGuid().ToString();

 

dock.ID =

string.Format("RadDock{0}", dock.UniqueName);

 

dock.Title = cmbSelectDock.SelectedItem.Text;

dock.Text =

string.Format("Added at {0}", DateTime.Now);

 

 

//dock.Width = Unit.Pixel(300); //-wants percentange but not working

 

 

 

 

dock.Commands.Add(

new DockCloseCommand());

 

dock.Commands.Add(

new DockExpandCollapseCommand());

 

dock.Command +=

new DockCommandEventHandler(dock_Command);

 

 

return dock;

 

}

 

private void CreateSaveStateTrigger(RadDock dock)

 

{

 

.

 

 

 

dock.AutoPostBack =

true;

 

dock.CommandsAutoPostBack =

true;

 

 

AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger();

 

saveStateTrigger.ControlID = dock.ID;

saveStateTrigger.EventName =

"DockPositionChanged";

 

UpdatePanel1.Triggers.Add(saveStateTrigger);

saveStateTrigger =

new AsyncPostBackTrigger();

 

saveStateTrigger.ControlID = dock.ID;

saveStateTrigger.EventName =

"Command";

 

UpdatePanel1.Triggers.Add(saveStateTrigger);

}

 

private void LoadWidget(RadDock dock)

 

{

 

if (string.IsNullOrEmpty(dock.Tag))

 

{

 

return;

 

}

 

Control widget = LoadControl(dock.Tag);

 

dock.ContentContainer.Controls.Add(widget);

}

 

protected void btnAddDock_Click(object sender, EventArgs e)

 

{

 

 

 

 

 

System.Web.Script.Serialization.

JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

 

objDockStateWS =

new DockStateWS();

 

dsDataSet =

new DataSet();

 

 

string strDockTagName = string.Empty;

 

 

try

 

 

 

 

{

dsDataSet = objDockStateWS.Fetch_Dock_State(0, 2);

 

if (dsDataSet.Tables["DockState"].Rows.Count > 0)

 

{

dockState =

Convert.ToString(dsDataSet.Tables["DockState"].Rows[0]["dock_state"]);

 

 

string[] currentDockStates = dockState.Split('|');

 

 

foreach (string stringState in currentDockStates)

 

{

 

if (stringState.Trim() != string.Empty)

 

{

 

DockState state = serializer.Deserialize<DockState>(stringState);

 

 

if (cmbSelectDock.SelectedItem.Text == state.Title)

 

{

 

if (state.Closed == false)

 

{

CurrentDockStates.Clear();

 

ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Exits", "javascript:alert('Exist');", true);

 

 

return;

 

}

 

else

 

 

 

 

{

LoadUserControlsDynamically();

}

}

 

else

 

 

 

 

{

LoadUserControlsDynamically();

}

}

}

}

 

else if (dsDataSet.Tables["DockState"].Rows.Count == 0)

 

{

LoadUserControlsDynamically();

}

}

 

catch (Exception ex)

 

{

LogMessage(ex, 1);

}

 

 

try

 

 

 

 

{

 

RadDock dock = CreateRadDock();

 

 

RadDockZone dz = (RadDockZone)FindControl(cmbZone.SelectedItem.Text);

 

dz.Controls.Add(dock);

CreateSaveStateTrigger(dock);

 

if (strDockTag == "Button")

 

{

 

Label lblTest = new Label();

 

lblTest.ID =

"lbl1";

 

lblTest.Text =

"Test Label";

 

dock.ContentContainer.Controls.Add(lblTest);

}

 

else

 

 

 

 

{

dock.Tag = strDockTag;

}

LoadWidget(dock);

}

 

catch (Exception ex)

 

{

LogMessage(ex, 1);

}

}

 

void LogMessage(Exception e, Int32 param)

 

{

 

if (param == 1)

 

{

lblMessage.Text = e.Message;

lblMessage.CssClass =

"error";

 

}

 

else

 

 

 

 

{

lblMessage.Text = e.Message;

lblMessage.CssClass =

"success";

 

}

}

 

 

private void LoadUserControlsDynamically()

 

{

 

string strControlID = string.Empty;

 

 

if (cmbSelectDock.SelectedValue == "CaseSummary")

 

{

 

UserControls_Case_Summary_CustCateg_Chart uclCaseSummary_Chart = (UserControls_Case_Summary_CustCateg_Chart)Page.LoadControl("~/UserControls/Case_Summary_CustCateg_Chart.ascx");

 

strControlID =

"uclCaseSummary_Chart" + TB_nUserID;

 

uclCaseSummary_Chart.GetCaseSummary();

strDockTag =

"UserControls/Case_Summary_CustCateg_Chart.ascx";

 

}

 

else if (cmbSelectDock.SelectedValue == "TaskSummary")

 

{

 

UserControls_Task_Summary_Chart uclTaskSummary_Chart = (UserControls_Task_Summary_Chart)Page.LoadControl("~/UserControls/Task_Summary_Chart.ascx");

 

strControlID =

"uclTaskSummary_Chart" + TB_nUserID;

 

uclTaskSummary_Chart.GetTaskSummary();

strDockTag =

"~/UserControls/Task_Summary_Chart.ascx";

 

}

 

else if (cmbSelectDock.SelectedValue == "MyTask")

 

{

 

UserControls_MyTask uclMyTask = (UserControls_MyTask)Page.LoadControl("~/UserControls/MyTask.ascx");

 

strControlID =

"uclTask" + TB_nUserID;

 

uclMyTask.GetTasks();

strDockTag =

"~/UserControls/MyTask.ascx";

 

}

 

else if (cmbSelectDock.SelectedValue == "MyCase")

 

{

 

UserControls_MyCase uclMyCase = (UserControls_MyCase)Page.LoadControl("~/UserControls/MyCase.ascx");

 

strControlID =

"uclCase" + TB_nUserID;

 

uclMyCase.GetCases();

strDockTag =

"~/UserControls/MyCase.ascx";

 

}

 

else if (cmbSelectDock.SelectedValue == "OverdueCases")

 

{

 

UserControls_OverdueCases uclOverdueCases = (UserControls_OverdueCases)Page.LoadControl("~/UserControls/OverdueCases.ascx");

 

strControlID =

"uclOverdueCase" + TB_nUserID;

 

uclOverdueCases.GetOverDueCases();

strDockTag =

"~/UserControls/OverdueCases.ascx";

 

}

 

else if (cmbSelectDock.SelectedValue == "Button")

 

{

strDockTag =

"Button";

 

}

}

 

protected void btnSaveDock_Click(object sender, EventArgs e)

 

{

 

try

 

 

 

 

{

 

//--Save Dock states in Database

 

 

 

 

System.Web.Script.Serialization.

JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

 

stateList = rdDockLayout.GetRegisteredDocksState();

 

while (i < stateList.Count)

 

{

serializedList.Append(serializer.Serialize(stateList[i]));

serializedList.Append(

"|");

 

i++;

}

dockState = serializedList.ToString();

 

if (dockState.Trim() != String.Empty)

 

{

objDockStateWS =

new DockStateWS();

 

dsDataSet =

new DataSet();

 

dsDataSet = objDockStateWS.Save_Dock_State(0, 2, dockState);

}

}

 

catch (Exception ex)

 

{

LogMessage(ex, 1);

}

}

}

thanks with reagrds

0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 20 May 2009, 02:35 PM

"The RadDock Prometheus control is built on top of ASP.NET AJAX.When debugging is enabled, ASP.NET AJAX uses a debug version of the client libraries.
Some information which may be helpful for you ,you can find on the following links:
http://www.asp.net/ajax/documentation/live/overview/ASPNETAJAXDebuggingAndTracingOverview.aspx,
and
http://weblogs.asp.net/scottgu/archive/2006/04/11/Don_1920_t-run-production-ASP.NET-Applications-with-debug_3D001D20_true_1D20_-enabled.aspx"

You could also use the  RadScriptManager and RadStyleSheetManager controls.

Tags
Dock
Asked by
Red
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Golu
Top achievements
Rank 1
Petio Petkov
Telerik team
Obi-Wan Kenobi
Top achievements
Rank 1
Share this question
or