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

Hierarchila tabstrip

19 Answers 236 Views
Tabstrip (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mukunda Manoj
Top achievements
Rank 1
Mukunda Manoj asked on 28 Nov 2006, 01:26 PM
Is it possible to have a hierarchial Tabstrip for winforms, similar to asp.net tabstrip?

19 Answers, 1 is accepted

Sort by
0
Chris
Telerik team
answered on 28 Nov 2006, 02:35 PM
Hi Mukunda,
Currently this behavior is achievable only by nesting TabStrips. You can't create a hierarchical TabStrip using one TabStrip only. Could you please give us some more details about the application in which you would like to use a hierarchical TabStrip control? Would you like to use databinding to build the TabStrip structure or you would like to build the whole TabStrip manually (in design-mode or using code)?

Best wishes,
Chris
the telerik team
0
Mukunda Manoj
Top achievements
Rank 1
answered on 28 Nov 2006, 03:55 PM
I need to build a Tabstrip which would be same as in the following example, but for windows forms.
http://www.telerik.com/demos/aspnet/TabStrip/Examples/Programming/HierarchicalBinding/DefaultCS.aspx

I need to build the TabStrip structure using databinding[not design mode].

I've a dropdown, when selected the tabstrip is populated. The tabstrip might have upto 3 levels and in some cases, just a single level.
When a tab in tabstrip is clicked, i need to populate a grid below the tabstrip.

Any example would be of great help as i'm new to win forms.

Thanks
Mukunda.
0
Chris
Telerik team
answered on 01 Dec 2006, 10:37 AM
Hi Mukunda,
I'm sorry for the late reply. I've prepared a sample application which reads hierarchical data from an .xml file which has the following structure:
<Tabs>
    <Tab Text="Tab1">
        <Tabs>
            <Tab Text="Tab1.1" />
            ...


and builds nested tabstrips which look like this:


You could use the same approach if you would like to populate the tabstrip control using a DataSet for example.
I hope this information helps.

Best wishes,
Chris
the telerik team
0
Mukunda Manoj
Top achievements
Rank 1
answered on 06 Dec 2006, 01:04 PM
Chris,

When i set the AutoSize property of the TabStrip and run the application(HierarchicalTabStrip), i get the following error.

Application has generated an exception that could not be handled.
Process ID=0x3f4(1012). blah blah
Click OK to Terminate the application.
Click CANCEL to debug the application.

If i set the autosize to false, it works.
If i set autosize to true and close Visual Studio and try to open the project, i cannot open the form. The studio closes and opens again.

With EnableTabControlMode=False and Autosize=True, application works fine, but only the first level of Tabs are seen.
1.) Is the Combination of EnableTabControlMode=true and Autosize=True
not supposed to be used?

Also, i need to fire an event when a tab is clicked.
[I was using TabCLick event of RadTabstrip in a web application]
There are 3 events which look confusing -- Click, MouseClick, TabSelected.
2.) Whats the diff between the above 3 events and which is more relevant to me [to have functionality similar to TabClick in a web application]?

3.) Is hierarchial RadTabstrip achievable in winforms, similar to that in Web, instead of adding another tabstrip to the contentpanel of the tabitem?
If so, is that going to be included in the future releases?
In current scenario, i have to add Sub-TabStrips manually and also attach the click event for the newly created Sub/Child-TabStrips to the same as Parent Tabstrip.
It would be better to have a single datasource binded to the control which manages relationships between child and parents as in RadTabStrip of web.

Regarding my application, each tab in the hierarchial TabStrip will be having its own description(readonly or Label) and Details(RichTextBox).
As i keep switching(selecting) the tabs, the selected tabs Description and details need to be displayed.
I guess my case doesn't need a content panel.

Can you please suggest me which would be a better way to achieve the functionality i need.

Thanks in advance,
Mukunda
0
Chris
Telerik team
answered on 06 Dec 2006, 04:51 PM
Hello Mukunda,
1) Yes, when the TabControlMode is enabled, setting the AutoSize mode to "true" should not have any effect. We couldn't reproduce locally the problem which you described when both properties are set to true but we'll test this case more carefully.
Btw, even though the AutoSize is set to false you could still dock and anchor the TabStrip control. Could you give us more details about your scenario?

2) Both Click and MouseClick events are inherited from the base System.Windows.Form.Control class. The MouseClick event is fired only when the click action is caused by clicking with the mouse and the Click event could be fired by other actions (button clicking, causing a click action programmatically, etc).
You could either handle the Click event of the tab items or you could handle the TabStrip.TabSelected event which is fired when the selected tab has been changed (either by clicking on it or programmatically).

3) Yes, true hierarchical TabStrip functionality is definitely on our TODO list for the next releases.

Best wishes,
Chris
the telerik team
0
Mukunda Manoj
Top achievements
Rank 1
answered on 06 Dec 2006, 05:29 PM
Thanks for the quick reply.
I took the HierarchicalTabStrip application attached by you, opened the form and set the AutoSize property of TabStrip to true and ran the application. Then i saw the error i mentioned in point 1.
I need to check the same on some other machines, if this has something to do with my studio installation/ machine settings/?.

When can i expect the hierarchical tabstrip?
If this is to be in next quarters release, it would be of great help for me.

The support provided by Teleik is great.
0
Chris
Telerik team
answered on 06 Dec 2006, 09:20 PM
Hi Mukunda,
I'm not quite sure whether the problem is on your side and whether it's connected with your VS settings. We'll test it thoroughly locally and if the problem is with our controls we'll provide a hotfix.
As for the hierarchical tabstrip control - we're planning to release it in Q1 2007.

Greetings,
Chris
the telerik team
0
Mukunda Manoj
Top achievements
Rank 1
answered on 07 Dec 2006, 02:12 PM
I tried in 3 different machines other than mine and had seen the same error whenever i specify the Autosize=True.
The version i was using is RadControlsWinforms_1_0_trial.exe that i downloaded on 22 nov.
0
Chris
Telerik team
answered on 08 Dec 2006, 09:15 AM
Hello Mukunda,
We managed to reproduce the problem and it will be fixed in the upcoming Q4 release (which is scheduled for the 20th of December).
Thanks for helping us improve our products.
I've just updated your telerik points.

Kind regards,
Chris
the telerik team
0
Mukunda Manoj
Top achievements
Rank 1
answered on 11 Jan 2007, 01:15 PM
When is the tabstrip with hierarchical functionality going to be released?
0
Vassil Petev
Telerik team
answered on 11 Jan 2007, 02:02 PM
Hi Mukunda,

We will have a ready to use hierarchy example in the Q1 release, due in March. Otherwise the problem mentioned below has already been fixed in the Q4 release (December 2006). Let us know if you have other questions.


Sincerely yours,
Rob
the telerik team
0
Vadlamudi VenuGopal
Top achievements
Rank 1
answered on 12 Jan 2007, 01:29 PM
1.) I cannot know which tab has been selected (visually).
Say, in below screenShot, i cannot say if Tab1 or Tab1.3 or Tab1.3.1 has been selected. Is it possible to have some different style for current selected tab?

2.) Is it possible to show certain tabs with a different style than the others.
[The tabs are from database and and have a flag associated with them. If flag=0, i need to have style1 and if flag=1 then style2 for the tabs.]
0
Mike
Telerik team
answered on 12 Jan 2007, 05:48 PM
Hi Vadlamudi,

All of our predefined themes have specified different style for selected tab items than the rest of the items. If you are creating a theme from scratch, you should use the RadTabStripElement.IsSelected property when creating a state (style-group) for the item. Although you could start creating a theme from scratch, we recommend you to start with some of the existing themes. Please let us know if you need any further assistance on the subject.
As a matter of fact I think it would be better if you use a different approach for customization. Since your application needs almost different style for each TabItem, you can consider creating the visual style using code-behind, setting the corresponding properties of each TabItem, as required. The properties you should use, can be referenced as follows:

FillPrimitive fill = (FillPrimitive)new ClassSelector("TabFill").GetSelectedElements(this)[0];

(The FillPrimitive class exists within the Telerik.WinControls.Primitives namespace).
Once you have a reference to the "fill" element, you can apply quite deep customization, playing with its properties:

fill.NumberofColors = 4;
fill.BackColor2
fill.BackColor3
fill.BackColor4
fill.GradientAngle  and so on.

Please, let me know if this works fine for you.

Best wishes,
Mike
the telerik team
0
Mukunda Manoj
Top achievements
Rank 1
answered on 22 Jan 2007, 04:00 PM
If i set AutoSize=true, the tabstrip disappears from the designer and also it is not seen in run mode(The Minsize was 0,0). When some min size is set, the tabstrip appears and it doesn't seem to resizing. It always has the min size only.
Is the resize property of tabstrip associated just with tabs and not the content panel??

How can i remove the background color and border color of the content panel, so that it looks more like a hierarchical tabstrip similar to the web based one?
0
Mike
Telerik team
answered on 22 Jan 2007, 05:55 PM
Hi Mukunda,

The RadTabStrip control is currently not able to determine its size by setting the autosize property to true. If you need to set its exact size, set AutoSize to false.

As to customizing the tabstrip looks, here is the modified sample, with hidden tab-content borders and fill. The main modifications are as follows:
 
//Make content invisible and collapse its border to achieve hierarchy effect  
FillPrimitive tabBaseFill = (FillPrimitive)new ClassSelector("TabBaseFill").GetSelectedElements(tabStrip.TabStripElement)[0];  
tabBaseFill.ShouldPaint = false;  
 
BorderPrimitive border = (BorderPrimitive)new ClassSelector("TabBaseBorder").GetSelectedElements(tabStrip.TabStripElement)[0];  
border.Visibility = ElementVisibility.Collapsed; 

We also set explicitly the theme name of the main tabstrip, to avoid overwriting of the present border and fill property values when the theme loads.
 

Regards,
Mike
the telerik team
0
Mukunda Manoj
Top achievements
Rank 1
answered on 27 Mar 2007, 09:34 AM
How can i iterate through the tabs from child to a parent.
If i click Tab1.3.1, i would like to get a reference to its parent Tab, 
Tab 1.3 and then its parent Tab1.

I was trying for some custom styling for the tab structure and need to traverse from child to parent and vice versa.
0
Mike
Telerik team
answered on 27 Mar 2007, 02:13 PM
Hi Mukunda Manoj,

Each RadElement, including TabItem, can access its owning control via the ElementTree.Control property. In case with the hierarchical TabStrip, the parent of a nested TabStrip control would be a control of type RadtabStripContentPanel. This panel has AssociatedItem property, which corresponds to the TabItem that is the owner of the content panel. Here is an example in code.
Say we have attached a dblClick event handler on each TabItem, in the hierarchy:
tabItem.DoubleClick += new EventHandler(tabItem_DoubleClick);

Then, in the event handler, we can access the parent(s) of the clicked tab item the following way:

void tabItem_DoubleClick(object sender, EventArgs e) 
    TabItem clickedItem = (TabItem) sender; 
    //Access Parent 
    RadTabStripContentPanel parentPanel = clickedItem.ElementTree.Control.Parent as RadTabStripContentPanel; 
    if (parentPanel != null
    { 
        MessageBox.Show(parentPanel.AssociatedItem.Text); 
 
        //Accsess Parent's Parent 
        parentPanel = parentPanel.AssociatedItem.ElementTree.Control.Parent as RadTabStripContentPanel; 
        if (parentPanel != null
        { 
            MessageBox.Show(parentPanel.AssociatedItem.Text); 
        } 
    } 

I hope this helps.

Regards,
Mike
the telerik team

Instantly find answers to your questions at the new telerik Support Center
0
Mukunda Manoj
Top achievements
Rank 1
answered on 15 May 2007, 12:53 PM
Has any new functionality been added to the t.a.b.Strip in the Q1 2007 release? I don't find anything new in the examples or the documentation expect for the new controls in this release.
0
Vassil Petev
Telerik team
answered on 15 May 2007, 01:28 PM
Hi Mukunda,

Our Q1 release is the last one we had for RadControls for WInForms. This is the reason why there is nothing new in the tabstrip. There will be several bug fixes In the upcoming service pack, but no new features. The service pack will be available for download tomorrow.


Greetings,
Rob
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Tabstrip (obsolete as of Q2 2010)
Asked by
Mukunda Manoj
Top achievements
Rank 1
Answers by
Chris
Telerik team
Mukunda Manoj
Top achievements
Rank 1
Vassil Petev
Telerik team
Vadlamudi VenuGopal
Top achievements
Rank 1
Mike
Telerik team
Share this question
or