I am using the RadTabStrip and dynamically setting the tab values from a database. Everything works fine except on PageLoad. Then it displays with no tab selected. How do I make the first tab to display as selected? This is using VB...
Thanks for any help.
Thanks for any help.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CNIPanelTestConnectionString %>"
SelectCommand="SELECT [TabName], [TabID] FROM [TabType]">
</asp:SqlDataSource>
<telerik:RadTabStrip ID="RadTabStrip1" runat="server"
DataSourceID="SqlDataSource1" DataTextField="TabName" DataValueField="TabID"
Skin="Blue" EnableEmbeddedSkins="False">
</telerik:RadTabStrip>
9 Answers, 1 is accepted
0
Hi Joe Weber,
You just need to set SelectedIndex property of the tabstrip:
Greetings,
Yana
the Telerik team
You just need to set SelectedIndex property of the tabstrip:
<
telerik:RadTabStrip
ID
=
"RadTabStrip1"
runat
=
"server"
DataSourceID
=
"SqlDataSource1"
DataTextField
=
"TabName"
DataValueField
=
"TabID"
Skin
=
"Blue"
EnableEmbeddedSkins
=
"False"
SelectedIndex
=
"0"
>
</
telerik:RadTabStrip
>
Greetings,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Joe Weber
Top achievements
Rank 2
answered on 20 Jul 2010, 04:24 PM
Thank you very much for your quick response; it worked perfectly.
If I may ask a similar question: I am also using RadPanelBars with the TabStrip. How do I select a specific RadPanel Item? For instance, on PageLoad, Tab 1 on the tab Strip is displayed as selected which will display RadPanelBar1. Now I want to show the first item on the RadPanelBar as selected.
Thank you again for any help with this.
If I may ask a similar question: I am also using RadPanelBars with the TabStrip. How do I select a specific RadPanel Item? For instance, on PageLoad, Tab 1 on the tab Strip is displayed as selected which will display RadPanelBar1. Now I want to show the first item on the RadPanelBar as selected.
Thank you again for any help with this.
0
Hi Joe,
Please use the following code line to select the first item:
Kind regards,
Yana
the Telerik team
Please use the following code line to select the first item:
RadPanelBar1.Items[0].Selected =
true
;
Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Joe Weber
Top achievements
Rank 2
answered on 22 Jul 2010, 05:16 PM
Again, thank you for your prompt reply. I am new to this so forgive my questions...
I tried your last suggestion but I get the following:
Index was out of range. Must be non-negative and less than the size of the collection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source Error:
Thank you for any help.
I tried your last suggestion but I get the following:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source Error:
|
Thank you for any help.
0
Hi Joe Weber,
How exactly you populate the panelbar? The error shows that you select an item before the items are actually loaded. Please send us more information about your scenario.
Regards,
Yana
the Telerik team
How exactly you populate the panelbar? The error shows that you select an item before the items are actually loaded. Please send us more information about your scenario.
Regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Joe Weber
Top achievements
Rank 2
answered on 28 Jul 2010, 03:49 PM
Thank you for your reply. Yes, I agree, I am trying to select an item before it is loaded. But how to load it first and then show it as selected?
What I am trying to do is display a tabbed list of groups of physicians. When the page loads it should show the first group and the first physician in that group as selected. The tabStrip and PanelBar are filled from an SQL database. The DB has two tables, one for the groups and one for the Physicians.
Thank you for any help.
What I am trying to do is display a tabbed list of groups of physicians. When the page loads it should show the first group and the first physician in that group as selected. The tabStrip and PanelBar are filled from an SQL database. The DB has two tables, one for the groups and one for the Physicians.
Thank you for any help.
0
Hi Joe ,
You can try to subscribe to DataBound (not ItemDataBound) event of the panelbar and select the first item in its handler.
Kind regards,
Yana
the Telerik team
You can try to subscribe to DataBound (not ItemDataBound) event of the panelbar and select the first item in its handler.
Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Joe Weber
Top achievements
Rank 2
answered on 29 Jul 2010, 03:28 PM
I'm not sure I exactly understand, can you give an example?
0
Accepted
Hi Joe,
I've attached a simple page to demonstrate this approach, download it and give it a try.
Best wishes,
Yana
the Telerik team
I've attached a simple page to demonstrate this approach, download it and give it a try.
Best wishes,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items