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

Next and Previous button

8 Answers 216 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Nguyen
Top achievements
Rank 1
Nguyen asked on 18 Jul 2012, 06:50 AM
Hi Telerik,

I'm trying to use RadDock in Your Demos and i have a problem:
When I add alot of documents ( such as 20 docs), the main screen only show 10 documents and i must click to OverlowDropdownButton on the right to know all document opened.

I wants to ask:
1. How to show Next and Previous Button beside OverflowDropdownButton
2. How to know that having other documents opened but not display in main screen (without click on OverflowDropdownButton)
3. How can i change Tabbed Style of Document Manager (ex: VS 2010, VS 2008, Office 2007, Office 2003,...)

My screen captured in attack file.

Thanks in advance!

8 Answers, 1 is accepted

Sort by
0
Nguyen
Top achievements
Rank 1
answered on 19 Jul 2012, 01:25 AM
Some one help me, plz...
0
Boryana
Telerik team
answered on 20 Jul 2012, 07:58 AM
Hi Nguyen,

Thank you for contacting us.

Let me get straight to the questions at hand:

1. The following snippet demonstrates how to display the left/right scroll buttons:
DocumentTabStrip tabStrip = this.radDock1.GetDefaultDocumentTabStrip(false);
tabStrip.TabStripElement.StripButtons = Telerik.WinControls.UI.StripViewButtons.Scroll;
tabStrip.RootElement.Children[0].Children[3].Margin = new Padding(0, 4, 0, 0);

2. You can get the document windows which are not currently displayed through comparing the ControlBoundingRectangle properties of the TabItem and the TabStrip. Here is a sample snippet:
List<RadPageViewItem> hiddenDocuments = new List<RadPageViewItem>();
foreach (RadPageViewItem item in tabStrip.TabStripElement.Items)
{
    if (item.ControlBoundingRectangle.X < tabStrip.TabStripElement.ItemContainer.ControlBoundingRectangle.X ||
        item.ControlBoundingRectangle.Right > tabStrip.TabStripElement.ItemContainer.ButtonsPanel.ControlBoundingRectangle.Left)
    {
        hiddenDocuments.Add(item);
    }
}

3. RadDock does not have a predefined styles that match exactly the styles you have mentioned. Our suite comprises predefined themes and each of these uses a unique combination of colors, shapes and effects. This help article illustrates in details how to use our default themes.

If you would like to introduce small changes to the tabs, e.g. change their shape and spacing, you can set these at run-time. For example, the following piece of code makes the tabs rectangular:
RoundRectShape shape = new RoundRectShape();
shape.Radius = 0;
 
foreach (RadPageViewItem item in tabStrip.TabStripElement.Items)
{
    item.Shape = shape;   
}
 
tabStrip.TabStripElement.ItemSpacing = 5;

All of the snippets above have been included in the attached sample project. Please have a look at it and let me know whether it fits your requirements.

I hope my answer is helpful. Let me know if you have further queries.

All the best,
Boryana
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Nguyen
Top achievements
Rank 1
answered on 23 Jul 2012, 01:36 AM
Thanks for your help,
I will try now and feedback later.
Thank telerik.
0
Nguyen
Top achievements
Rank 1
answered on 23 Jul 2012, 04:48 AM
Thanks for your help again,

Great, that's exactly what i need.
But there's a other problem: When i click to OverflowDropdowButton to show all document opened, it don't check on current active document.
What option do that?

Thanks!
0
Boryana
Telerik team
answered on 23 Jul 2012, 01:25 PM
Hello Nguyen,

Thank you for writing.

You can use the default PageView overflow button, which displays a checkmark next to the selected item by default. You will need to hide the DockLayoutPanel containing the Dock's overflow and close buttons, and reset the Padding of the StripViewItemContainer. Here is a sample snippet:
//1. Show Next and Previous Buttons
tabStrip = this.radDock1.GetDefaultDocumentTabStrip(false);
tabStrip.TabStripElement.StripButtons = StripViewButtons.All;
DockLayoutPanel dockPanel = tabStrip.RootElement.Children[0].Children[3] as DockLayoutPanel;
if(dockPanel != null)   
{
    dockPanel.MaxSize = new System.Drawing.Size(1, 1);
}
StripViewItemContainer stripContainer = tabStrip.TabStripElement.Children[0] as StripViewItemContainer;
if (stripContainer != null)
{
    stripContainer.Padding = new Padding(stripContainer.Padding.Left, stripContainer.Padding.Top, 0, stripContainer.Padding.Bottom);
}

I hope this helps. Let me know if you have further questions.

All the best,
Boryana
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Nguyen
Top achievements
Rank 1
answered on 24 Jul 2012, 11:05 AM
Thanks you very much,

I used your code, and it runs OK.
But when i splits screen into more than one dock zone, it's only OK with first dock screen.
Please view my attack image.

Sorry if I asked too much.
Regards,
0
Boryana
Telerik team
answered on 26 Jul 2012, 03:07 PM
Hello Nguyen,

Thank you for writing back.

I have modified the sample project, so that now each DocumentTabStrip contains the same buttons regardless of the way you reorganize the DocumentWindows.

I hope this helps. Let me know if you have further queries. 

All the best,
Boryana
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Nguyen
Top achievements
Rank 1
answered on 30 Jul 2012, 04:59 AM
Hi Telerik,

That's exactly all i need.

Thanks you very much!
Tags
Dock
Asked by
Nguyen
Top achievements
Rank 1
Answers by
Nguyen
Top achievements
Rank 1
Boryana
Telerik team
Share this question
or