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

ComboBox HTML output

5 Answers 138 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 13 Feb 2013, 04:54 PM
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???

5 Answers, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 14 Feb 2013, 04:41 PM
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.
0
Carlos
Top achievements
Rank 1
answered on 14 Feb 2013, 05:47 PM
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??????

0
Accepted
Hristo Valyavicharski
Telerik team
answered on 19 Feb 2013, 01:09 PM
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.
0
Carlos
Top achievements
Rank 1
answered on 19 Feb 2013, 04:35 PM
@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
0
Hristo Valyavicharski
Telerik team
answered on 22 Feb 2013, 02:56 PM
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.
Tags
ComboBox
Asked by
Carlos
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Carlos
Top achievements
Rank 1
Share this question
or