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

Calling Radtab ID in need data source

3 Answers 71 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Molivia Sa
Top achievements
Rank 1
Molivia Sa asked on 10 Mar 2010, 06:01 AM
Dear Telerik,

How do you call Radtab pageview id in need data source.

For example:

 

 <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Black" MultiPageID="RadMultiPage1" 
                        SelectedIndex="0" Width ="300px" ontabclick="RadTabStrip1_TabClick">  
                        <Tabs>  
                            <telerik:RadTab Text="Bronze" PageViewID="Bronze">  
                            </telerik:RadTab>  
                            <telerik:RadTab Text="Silver" PageViewID="Silver">  
                            </telerik:RadTab>  
                            <telerik:RadTab Text="Gold" PageViewID="Gold">  
                            </telerik:RadTab>  
                            <telerik:RadTab Text="Black" PageViewID="Black">  
                            </telerik:RadTab>  
                        </Tabs>  
            </telerik:RadTabStrip> 


protected void grdCard_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            int CardColour = 0;  
            if (RadTabStrip1.SelectedTab.Text == "Silver")  
            {  
                CardColour = Convert.ToInt32(EnumAutoGenerated.MemberCardType.Silver);  
            }  
            else if (RadTabStrip1.SelectedTab.Text == "Gold")  
            {  
                CardColour = Convert.ToInt32(EnumAutoGenerated.MemberCardType.Gold);  
            }  
            else 
            {  
                CardColour = Convert.ToInt32(EnumAutoGenerated.MemberCardType.Silver);  
            }  
 
            MemberCardCollection oMemberCardCollection = new MemberCardCollection();  
            oMemberCardCollection.Query.Select();  
            oMemberCardCollection.Query.Where(oMemberCardCollection.Query.McrStaIDType.Equal(CardColour));  
            oMemberCardCollection.Query.Load();  
            grdCard.DataSource = oMemberCardCollection;  
 
        } 

 

 

I tried this but it only pick that last colour only, which is 3.

Thank you

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 15 Mar 2010, 08:29 AM
Hello Molivia Sa,

I could not reproduce the problem in a simple test page.
In NeedDataSource event the SelectedTab.Text points to the correct tab and text.

<telerik:RadGrid ID="RadGrid1" runat="server"
    onneeddatasource="RadGrid1_NeedDataSource">
</telerik:RadGrid
 
 <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Black" MultiPageID="RadMultiPage1"
    SelectedIndex="2" Width ="300px" ontabclick="RadTabStrip1_TabClick"
    <Tabs
        <telerik:RadTab Text="Bronze" PageViewID="Bronze"
        </telerik:RadTab
        <telerik:RadTab Text="Silver" PageViewID="Silver"
        </telerik:RadTab
        <telerik:RadTab Text="Gold" PageViewID="Gold" Selected="True"
        </telerik:RadTab
        <telerik:RadTab Text="Black" PageViewID="Black"
        </telerik:RadTab
    </Tabs
</telerik:RadTabStrip>

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
    Response.Write(RadTabStrip1.SelectedTab.Text);
}

What could be different in your case?

Regards,
Veskoni
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
Molivia Sa
Top achievements
Rank 1
answered on 16 Mar 2010, 11:08 PM
Dear Telerik Team,

I tried the sample above, but no success. It still displaying nothing.

is there anyway to point out that - if you click a bronze tab then it display bronze data
                                                    -  if you click a silver tab then it display silver data 
                                                    - soon

Thank you



                                            
0
Veselin Vasilev
Telerik team
answered on 22 Mar 2010, 10:52 AM
Hello Molivia Sa,

I am not sure what could be the problem at your end. Can you please send us a sample running page in a support ticket so we can inspect it locally?

Thanks

Sincerely yours,
Veskoni
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.
Tags
TabStrip
Asked by
Molivia Sa
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Molivia Sa
Top achievements
Rank 1
Share this question
or