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

ComboBox / Templates - width problem

1 Answer 103 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Elton Ho
Top achievements
Rank 1
Elton Ho asked on 10 Jun 2011, 12:31 PM
Hi,

I followed the ComboBox sample http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/templates/defaultcs.aspx in order to use the Combobox with checkboxes. In the sample, I found that the width of the combox is fixed. However, in my case, I would like to unspecify it so that the combobox can be expand / shrink according to its container / browser.

Pls. kindly advise.


Thanks,
Elton

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 14 Jun 2011, 06:22 PM
Hello Elton Ho,

I am afraid that changing the RadComboBox width upon browser window resizing is not supported.

You can try to nest the control in a "div" with 100% width, and then set the RadComboBox Width property to a percentage value:

<div style="width: 100%; background-color: Blue;">
<telerik:RadComboBox ID="RadComboBox1"
runat="server" Width="50%">
<ItemTemplate>
<telerik:RadTreeView runat="server"
    ID="RadTreeView1" Width="100%"
    Height="140px">
    <Nodes>
        <telerik:RadTreeNode runat="server"
            Text="Africa" Expanded="true">
            <Nodes>
                <telerik:RadTreeNode runat="server" Text="Egypt">
                    <Nodes>
                        <telerik:RadTreeNode runat="server"
                            Text="Cairo">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
                <telerik:RadTreeNode runat="server"
                    Text="South Africa">
                    <Nodes>
                        <telerik:RadTreeNode runat="server"
                            Text="Cape Town">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
                <telerik:RadTreeNode runat="server" Text="Kenya">
                    <Nodes>
                        <telerik:RadTreeNode runat="server"
                            Text="Nairobi" >
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
            </Nodes>
        </telerik:RadTreeNode>
    </Nodes>
</telerik:RadTreeView>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem Text="" />
</Items>
</telerik:RadComboBox>
</div>


All the best,
Kalina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
ComboBox
Asked by
Elton Ho
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or