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

Rebinding RadTabStrip on postback

1 Answer 54 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 20 Jun 2011, 03:48 PM
Hi,

I need to rebind the TabStrip after postback.
In my case, the contents of the tabstrip changes after the page postbacks.

Am getting exception when i do this 

protected void Page_Load(object sender, EventArgs e)
{    
    if (!IsPostBack)
    {
        BindTabStrip();
    }
    else
    {               
           BindTabStrip();
    }
}


Am not getting exception when i do this, but i dont get the updated TabStrip:
protected void Page_Load(object sender, EventArgs e)
{
    db = (DataLib_oracle)Session["db_lib"];
    if (!IsPostBack)
    {
        BindTabStrip();
    }
    else
    {               
        RadTabStrip1.DataSource = ds;
        RadTabStrip1.DataBind();
    }
}

Let me know if there is better way to do the rebinding of tabstrip on page postback.

Following is the code for BindTabStrip()
private void BindTabStrip()
{
     DataSet ds = getDataSet();    
 
    RadTabStrip1.DataFieldID = "web_form_id";
    RadTabStrip1.DataTextField = "FORM_NAME";
    RadTabStrip1.DataSource = ds;
    RadTabStrip1.DataBind();
}

Thanks,
Mani

1 Answer, 1 is accepted

Sort by
0
Accepted
Veronica
Telerik team
answered on 22 Jun 2011, 12:17 PM
Hello Manikandan Balasubramaniyan,

Actually the right scenario is to call BindTabStrip() only in the !IfPostBack condition and call DataBind() in the other case:
protected void Page_Load(object sender, EventArgs e)
{   
    if (!IsPostBack)
    {
        BindTabStrip();
    }
    else
    {               
       RadTabStrip1.DataBind();
    }
}

Hope this helps.

Greetings,
Veronica Milcheva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
TabStrip
Asked by
Manikandan Balasubramaniyan
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or