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

Appn startup time and selection of Tab Item programmatically

4 Answers 218 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 22 Feb 2007, 02:05 PM
1.) I've been using the TabStrip of R.a.d. Controls for winforms.
The application startup time has increased since i've added a tabstrip to one of my forms.
I've just dragged the tabstrip from the toolbox and added three items to it. In addition to the tabstrip, my form has a few labels and text boxes on the form.

2.) In Designer, selected a tab and the shape property shows "TabOffice12Shape". I tried setting it to some other by selecting from the dropdown available. It works fine. If i try to change it something else, the system gets hanged on for a moment and then the visual studio gets closed. This happens if i try to change the shape for the second time. Is this not supposed to be changed more than once?

3.) How can i select an item in the tabstrip programmatically?
Is there something like RadTabStrip1.items.item(0).select() ??
How can i avoid selection of first element by default?
I want no item on tabstrip to be selected when form is loaded and the user would click on an item to select.

I'm using RadControlsWinforms_Q4_2006_SP1_trial_setup.exe.

4 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 23 Feb 2007, 08:17 AM
Hello Magenta,

We couldn't reproduce your problem with TabStrip's Shape property with our latest  release. Please download and install the Q42006 SP2  version and try with it instead.

To select a TabItem do one of the following:

  1. radTabStrip.SelectedTab = myTab
  2. myTab.IsSelected = True
 

Kind regards,
Tsvetan Raikov
the telerik team
0
Simon Durant
Top achievements
Rank 1
answered on 26 Feb 2007, 06:02 AM
Just to confirm, there's no way to programmatically set the tab based on some form of index?? I want to use the tabstrip as the basis for a wizard screen, where the user can click on previous & next buttons to set the appropriate tab.

No worries, i'm using the following code to 'step' forwards and backwards...

private void btnPrevious_Click(object sender, EventArgs e)  
{  
    Telerik.WinControls.RadItem item = rtsWizard.SelectedTab as Telerik.WinControls.RadItem;  
    int index = rtsWizard.Items.IndexOf(item) - 1;  
    rtsWizard.SelectedTab = rtsWizard.Items[index];  
}  
 
private void btnNext_Click(object sender, EventArgs e)  
{  
    Telerik.WinControls.RadItem item = rtsWizard.SelectedTab as Telerik.WinControls.RadItem;  
    int index = rtsWizard.Items.IndexOf(item) + 1;  
    rtsWizard.SelectedTab = rtsWizard.Items[index];  
0
Boyko Markov
Telerik team
answered on 26 Feb 2007, 09:49 AM
Hello Simon,

I was unable to reproduce the problem with the latest version of rad Tabstrip. I created a sample project with the RadTabStrip control and did the following:
  1. Dragged and dropped a new instance of radTabStrip from the VS2005 toolbox.
  2. Dragged and dropped two new instances of radButton from the VS2005 toolbox and named them Previous and Next
  3. Handled the click events of those buttons and pasted your source code there
  4. Added three TabItems to the RadTabStrip and placed an instances of RadButton on the first, RadCheckBox on the second and RadTrackBar on the third.
When I clicked the previous or next buttons I was successfully moved back and forth to the the selected tabItem.

Hint: You could add a check about getting an  IndexOutOfRange exception because there is no check whether the index of the tabItem is valid when you change the selected tab.

Can you give us more information on the version you are currently using? The problem you are experiencing may be related to an older versions of our suite. If you could reproduce the problem with the latest version of RadControls for WinForms (Q4 SP2),  please send us a sample project where the error is present. You can do so in a new support ticket.
 

Greetings,

Ray
the telerik team
0
Simon Durant
Top achievements
Rank 1
answered on 27 Feb 2007, 05:04 AM
Just to clarify, my original post was asking how i could programmatically move between tabs ( without iterating through the items collection etc ). I found a way to do that after posting, so i edited my post ( from 'No worries' down ) to say that all was good.
Tags
Tabstrip (obsolete as of Q2 2010)
Asked by
Mukunda Manoj
Top achievements
Rank 1
Answers by
Jack
Telerik team
Simon Durant
Top achievements
Rank 1
Boyko Markov
Telerik team
Share this question
or