Calling Radtab ID in need data source

4 posts, 0 answers
  1. Molivia Sa
    Molivia Sa avatar
    9 posts
    Member since:
    Jan 2010

    Posted 10 Mar 2010 Link to this post

    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

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 15 Mar 2010 Link to this post

    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.
  3. Molivia Sa
    Molivia Sa avatar
    9 posts
    Member since:
    Jan 2010

    Posted 16 Mar 2010 Link to this post

    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



                                                
  4. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 22 Mar 2010 Link to this post

    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.
Back to Top