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

Removing Tabs from Tabstrip

1 Answer 82 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Manikandan Balasubramaniyan
Top achievements
Rank 1
Manikandan Balasubramaniyan asked on 16 Jun 2011, 09:49 PM
Hello,
Am trying to remove the tabs from the tabstrip. 
But am getting the following exception:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

int count = RadTabStrip1.Tabs.Count();
if (count > 0)
      {
          for (int i = 0; i < count;i++ )
                {
                    RadTabStrip1.Tabs.RemoveAt(i);
                }
       }

Any advise?

Thanks,
Mani

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Jun 2011, 09:02 AM
Hello Manikandan,

I have changed the code like below and which worked as expected.
C#:
protected void Button3_Click(object sender, EventArgs e)
    {
        int count = RadTabStrip1.Tabs.Count;
        if (count > 0)
        {
            for (int i = count-1; i>=0; i--)
            {
                RadTabStrip1.Tabs.RemoveAt(i);
            }
        }
    }

Thanks,
Shinu.
Tags
TabStrip
Asked by
Manikandan Balasubramaniyan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or