Well I am trying to change the tab heading titles programmatically at runtime...just trying out the trial version...I am new...so please don't mind my ignorance...I tried to search but in vain.Everytime I tried to change the text property of the radtab from code behind...I end up with an object null reference error...lemme tell you what I tried...I need to know as to how do we set the title of a tab at runtime without ending up with an "Object reference not set to an instance of an object." error.
public partial class JobseekerHome : BasePage |
{ |
#region RadStripBar |
protected override void Page_Load(object sender, System.EventArgs e) |
{ |
if (!Page.IsPostBack) |
{ |
AddTab("LanguageUC", "Mini profile"); |
AddPageView(RadTabStrip1.FindTabByText("LanguageUC")); |
AddTab("OrdersCS", "Experience"); |
AddTab("ProjectUC", "Experience"); |
} |
} |
private void AddTab(string tabValue, string tabName) |
{ |
RadTab tab = new RadTab(); |
tab.Text = tabValue; |
tab.Value = tabName; |
RadTabStrip1.Tabs.Add(tab); |
} |
protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e) |
{ |
string userControlName = e.PageView.ID + ".ascx"; |
Control userControl = Page.LoadControl(userControlName); |
userControl.ID = e.PageView.ID + "_userControl"; |
e.PageView.Controls.Add(userControl); |
e.PageView.FindControl(RadTabStrip1.FindTabByText("LanguageUC").Text="Language"); |
e.PageView.FindControl(RadTabStrip1.FindTabByText("OrdersCS").Text = "Orders"); |
} |
private void AddPageView(RadTab tab) |
{ |
RadPageView pageView = new RadPageView(); |
pageView.ID = tab.Text; |
RadMultiPage1.PageViews.Add(pageView); |
pageView.CssClass = "pageView"; |
tab.PageViewID = pageView.ID; |
} |
protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e) |
{ |
AddPageView(e.Tab); |
e.Tab.PageView.Selected = true; |
} |
#endregion |