ComboBox HTML output

6 posts, 1 answers
  1. Carlos
    Carlos avatar
    69 posts
    Member since:
    Jun 2011

    Posted 13 Feb 2013 Link to this post

    Is there a Rad control to use that acts like a ComboBox but outputs a 
    <select>
    <option></option>
    </select>

    instead of the <ul> <li> it creates?  On mobile devices we want the list to pop up the device's default select option viewer. But since the Rad ComboBox generates a ul li this is not possible.  
    Wouldn't it have been a better option to develop the ComboBox as a <select> instead of a <ul>?  I am not quite sure of the reasoning behind that.
    But either way, is there a rad control that outputs a <select> drop down list instead of the <ul>.

    Thanks in advance.

    EDIT:

    So a revision to my question. We found that there is a property for the ComboBox to set RenderingMode="Simple", HOWEVER, it does not seem to be switching out our RadComboBox to <select> elements, it is keeping the default. I checked the HTML output in Firebug and nothing has changed.  The RadComboBox is inside a RadGrid that is triggered when "Add new record" selected.
     Any reasons why setting the RenderingMode to Simple doesn't work???
  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 14 Feb 2013 Link to this post

    Hi Carlos,

    Setting RenderingMode="Simple" should render RadComboBox as a select element. More about this property you can read here. It doesn't matter if the combo is inside grid or not. Just be sure that you set it correctly. The output should be something similar to this screenshot.

    Regards,
    Hristo Valyavicharski
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Carlos
    Carlos avatar
    69 posts
    Member since:
    Jun 2011

    Posted 14 Feb 2013 Link to this post

    So we found where it renders the <select>  BUT we found out that when rendered the style on the <select> tag is pushed -9999px and position fixed.
    But the thing is, it is rendering BOTH a <select> AND the <ul><li>. 

    I am attaching images of my Firebug and a picture of what it looks like when we render on the page and take off the -9999px and positioned fixed.  

    1. Showing when RenderingMode="Simple" it still shows the "FULL".
    2. Firebug showing in the HTML that ComboBox renders both Simple AND Full
    3. Renders Both
    4. RadComboBox aspx  

    When I took these off the select came into view. Should't it just take over the other one.

    Any suggestions??????

  4. Answer
    Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 19 Feb 2013 Link to this post

    Hi Carlos,

    Using RenderingMode="Simple" should disable the skin for the combo and render it as simple select element. In addition, do you use a FormDecorator? If you have FormDecorator, your combo will not be rendered as a simple html element.

    This what you can try is to use RenderingMode="simple", remove FormDecorator and try to style the output select to look like a RadComboBox with MetroTouch skin. Note that it cannot be styled exactly as the combo but at least basic look can be achieved.

    Kind regards,
    Hristo Valyavicharski
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Carlos
    Carlos avatar
    69 posts
    Member since:
    Jun 2011

    Posted 19 Feb 2013 Link to this post

    @Hristo,

    The form decorator was the issue, thanks for the answer.  
    Is that documented in the RadComboBox RenderingMode documentation?
    I didn't see it. If not, could you guys put that in the documentation for that control?  It is a little confusing like in our situation to try and figure out what the issue was.

    Thanks,

    Carlos
  6. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 22 Feb 2013 Link to this post

    Hi Carlos,

    I have logged this behavior as a new development issue. To keep track on it please click on this link.
    Note that in the new version 2013 Q1 this property "RenderingMode" is obsolete. It will be replaced by
    "RenderMode". For more information please check this out.

    Greetings,
    Hristo Valyavicharski
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top