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

Dynamic RadPageView question

0 Answers 88 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
chris
Top achievements
Rank 1
chris asked on 14 Sep 2008, 04:24 PM
I have used the example that you have under Dynamic RadPageView to create a form with tabs for different languages. The languages are dynamic so i do not know what languages the user is going to add to the system and they also all have the same
fields so i am using the same control for each tab but just giving the control a different name. I do not know the controls name (well i do but it is not created yet so i can not figure out a way to get the info in text boxes and put them into the database. Any idea's?

Below is the code i am using to create the tabs and call the control 1 to 100 times.
The create controls called
English_page_userControl
or
Spanish_page_userControl
on the fly

ublic partial class StoreCategoriesEdit2 : System.Web.UI.Page 
    //initalize the Security 
    public static string Security_level = ""
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
         
        //check to make sure that we are allowed to see this page 
        Security_level = AdminSecurity.Page_Security("users"); 
        if (Security_level == "" || Security_level == "N"
        { 
             
            Messaging.ErrMsg("You Do Not Have Rights To View This Page."); 
        } 
 
        if (!IsPostBack) 
        { 
                string MySql = "Select FrontEndLanguageId,FrontEndLanguageName " 
                     + "From SystemFrontEndLanguage " 
                     + "Order By FrontEndLanguageIsDefualt Desc"
                DataSet rs = DataAccess.ExecuteSqlWithResults(MySql); 
                foreach (DataRow row in rs.Tables[0].Rows) 
                { 
                   AddTab(row["FrontEndLanguageName"].ToString()); 
                } 
                rs.Dispose(); 
                 
            
                MySql = "SELECT a.CategoriesId, b.CategoryLanguageDescription " 
                    + "FROM (StoreCategories AS a " 
                    + "INNER JOIN StoreCategoryLanguage AS b " 
                    + "ON a.CategoriesId = b.CategoriesId) " 
                    + "INNER JOIN SystemFrontEndLanguage AS c " 
                    + "ON b.FrontEndLanguageId = c.FrontEndLanguageId " 
                    + "WHERE (((c.FrontEndLanguageIsDefualt)=\"Y\"))"
               rs = DataAccess.ExecuteSqlWithResults(MySql); 
                if (rs.Tables[0].Rows.Count != 0 ) 
                { 
                    CategoriesParentIdDropDownList.DataSource = rs; 
                    CategoriesParentIdDropDownList.DataValueField = "CategoriesId"
                    CategoriesParentIdDropDownList.DataTextField = "CategoryLanguageDescription"
                    CategoriesParentIdDropDownList.DataBind(); 
                } 
                else 
                { 
                    CategoriesParentIdDropDownList.Visible = false
                } 
                rs.Dispose(); 
                
        } 
    } 
 
    private void AddTab(string tabName) 
    { 
        RadTab tab = new RadTab(); 
        tab.Text = tabName; 
        tab.PageViewID = tabName + "_page"
        RadTabStrip1.Tabs.Add(tab); 
        RadPageView pageView = new RadPageView(); 
        pageView.ID = tabName + "_page"
 
        RadMultiPage1.PageViews.Add(pageView); 
    } 
 
    protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e) 
    { 
        string userControlName = "Controls/CategoriesLanguages.ascx"
        Control userControl = Page.LoadControl(userControlName); 
        userControl.ID = e.PageView.ID + "_userControl";  
 
 
        e.PageView.Controls.Add(userControl); 
         
    } 
 


 

No answers yet. Maybe you can help?

Tags
TabStrip
Asked by
chris
Top achievements
Rank 1
Share this question
or