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

Scrolling Problems

1 Answer 96 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.
BillFugina
Top achievements
Rank 1
BillFugina asked on 10 Sep 2008, 06:20 PM

I 'm working on a program that uses a RadTabStrip. The program has two static tabs and then allows the user to add more at runtime.  Once the new tabs are added, they cannot be removed, but they can be hidden.

I am having two problems:

The first problem happens when the user adds several tabs that exceed the width of the window and the scroll buttons become visible.   If the user scrolls over to the tabs on the right and then hides some tabs, the scroll buttons disappear and there is no way to easily get to the tabs that have scrolled off the left side of the form.

I figured that I would program my own scroll buttons and ran into the scond problem.  My buttons work well except for scrolling to the left most tab.  When I attempt to scroll to the left most tab, the program gets cought in an endless loop.

I have an example program you can download from my website.  It is a very small program that demontrates the problem.  It has a RadTabStrip and several buttons.  The first button allows adding tabs.  The second button hides the tabs one at a time. The third button unhides tabs one at a time.  The fourth button attempts to scroll to the left.

  1. Run the program
  2. Hit the "Add Tab" button four or five times until the scroll buttons pop up.
  3. Use the scroll buttons to scroll all the way over to the right until the right scroll buttons disables itself.
  4. Hit the "Hide Tab" button two or three times until the scroll buttons disappear.
  5. Note that there is no easy way to get to the left most tabs.
  6. Hit the "Scroll Left" button a few times to try to get to the left most tab.
  7. When you get to the left most tab the program will now be cought in an endless loop.

I hope this example illustrates the problems.  Please let me know if you have any questions.

Ideally, I would like to be able to have the scroll buttons visible all the time.  Also, I would like to be able to programatically scroll to the left most tab without getting cought in a loop.  However, I'm willing to listen to any suggestions or work arounds.

Thank you for your help.

1 Answer, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 12 Sep 2008, 04:01 PM
Hello BillFugina,

Thank you for contacting us.

In the hide button click handler do the following:

  private void hideATabButton_Click(object sender, EventArgs e) {
            if (tabList.Count > 0) {
                int ndx = tabList.Count - 1;
                TabItem tabItem = tabList[ndx];
                while (tabItem.Visibility != ElementVisibility.Visible && ndx > 0) {
                    tabItem = tabList[--ndx];
                }
                if (tabItem != null && tabItem.Visibility == ElementVisibility.Visible) {
                    tabItem.Visibility = ElementVisibility.Collapsed;
                }

            }

            this.radTabStrip1.TabStripElement.TabLayout.ScrollItemsOffset = 0;
        }

Note that I've added a code which resets the scrolling. I hope this helps.

Please write me back if you need more information.
 

Sincerely yours,
Boyko Markov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Tabstrip (obsolete as of Q2 2010)
Asked by
BillFugina
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Share this question
or