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

Determine which tab is selected in code behind

3 Answers 15 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 14 Nov 2020, 02:55 PM
I have a page with three tabs and three pageviews. Each tab/pageview has a radgrid. I have a button that calls server side code that does a MasterTableView.ExportToCSV. I would like to be able to determine which tab/pagewview is selected so that I can do the export for the grid in that selected pageview.

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 18 Nov 2020, 08:33 PM

Hi Thomas,

Both the TabStrip and the MultiPage keep information about the SelectedIndex, so you can access these values on the server-side when needed.

For example:

        int index = RadTabStrip1.SelectedIndex;
        RadPageView selectedView =  RadMultiPage1.PageViews[index];

        //or
        //int viewIndex = RadMultiPage1.SelectedIndex;
        //RadPageView selectedView = RadMultiPage1.PageViews[viewIndex];

 

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Thomas
Top achievements
Rank 1
answered on 18 Nov 2020, 09:07 PM
Awesome. Exactly what I needed. Thank you.
0
Vessy
Telerik team
answered on 18 Nov 2020, 09:30 PM

Hi,

You are welcome, Thomas :)

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
TabStrip
Asked by
Thomas
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or