Placing a control in the menu?

8 posts, 1 answers
  1. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 07 May 2009 Link to this post

    I would like to know how to place a control in the menu.. I want to integrate a radcombobox.... sort of like you have the search bar integrated into your (telerik) navbar.

    I know how to do it in photoshop :)

    the skin is Black... and pretty much standard..

    the combobox would be populated by a couple fields in a table.. (but I have all the data streams worked out) i just need to know how to seamlessly place a radcombobox on the right side inside of a radmenu strip, regardless of there only being 2 or 3 items in the menu...

    here is a link to the site where the menu is... you will see that there is only 1 item in the menu.. and the menu stretches to the width of the page... (980px in this case)

    http://giovanniscoalfirepizza.com






  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 08 May 2009 Link to this post

    Hello,

    Please find attached a simple page demonstrating the needed approach. Download it and give it a try.

    Regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 08 May 2009 Link to this post

    That answers the how... at design time...

    I was looking at the add templates at runtime.. (because the combobox must be populated by codebehind)

    I referred to this article: http://www.telerik.com/help/aspnet-ajax/menu_menu_templates_run_time.html

    But for some reason.. its not working out.. I am getting 2 comboboxes in the menu.. and no regular items..

    the menu is created in codebehind.. it binds from a table.. after it binds, I want the combobox to be added.. (on the right hand side)

    How can I accomplish this?

    thanks!

    Jeff

  5. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 08 May 2009 Link to this post

    The menu is populated by a table in the codebehind...

    after those items are added, I would like to add the combobox and place it on the right hand side as I mentioned originally.

    Here is the bit of code that binds the table to the menu...

    protected void Page_Load(object sender, EventArgs e) 
        {  
                         
            
            if (!IsPostBack) 
            { 
                SiteInfo si = DataRepository.SiteInfoProvider.GetBySiteId(1); 
     
                RadMenu1.Skin = si.Skin; 
                lblLogo.Text = si.Logo; 
     
     
                RadMenu1.DataSource = GetMenu(); 
                //Establish hierarchy: 
                RadMenu1.DataFieldID = "PagesMenuID"
                RadMenu1.DataFieldParentID = "ParentID"
                //Set Text, Value, and NavigateUrl: 
                RadMenu1.DataTextField = "Name"
                RadMenu1.DataValueField = "PagesMenuID"
                RadMenu1.DataNavigateUrlField = "URL"
     
                             
                RadMenu1.DataBind(); 
     
                RadMenuItem ri = new RadMenuItem(); 
                ri.CssClass="rightAligned"
                ri.Text="test"
     
                RadMenu1.Items.Add(ri); 
     
               
            } 
             
             
     
        } 


    But even when i simply added the item.. and rightAligned it, it did not show up on the right hand side...

    and I did add the <style> tag with the right aligned that you gave me in the sample project.

    You can see it live...

    http://www.giovanniscoalfirepizza.com

    I need to know how to add the combobox.. in codebehind.. after the menu items have been added... or with the items being added.. but it needs to be on the right hand side.

    Thanks and Regards,

    Jeff



  6. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 11 May 2009 Link to this post

    Hello Jeff,

    I've modified the page to show you how to add RadComboBox dynamically, you're right - the style doesn't work, so I added new styles. Please download the attached file and try it.

    Best regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 11 May 2009 Link to this post

    Now that is what I was looking for!  However, I have one more question to finish the job...

    If I make the combobox autopostback, how do I handle the postback?

    Thanks!

    Jeff
  8. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 11 May 2009 Link to this post

    Hi Jeff,

    I've attached the modified page again to demonstrate how to subscribe to SelectedIndexChanged event form code-behind.

    Regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 11 May 2009 Link to this post

    It works exactly as I pictured it...

    I have a Profile Property that remembers a clients location.... with anonymous authentication...

    and that works in conjunction with the combobox on the top right hand part of the menu.

    The combobox is populated by the locations the admin puts into the system...

    Once again, you have provided exactly what i needed.

    Thanks again!

    Jeff
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017