ComboBox / Templates - width problem

2 posts, 0 answers
  1. Elton Ho
    Elton Ho avatar
    3 posts
    Member since:
    Sep 2009

    Posted 10 Jun 2011 Link to this post

    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
  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 14 Jun 2011 Link to this post

    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.

Back to Top