Have Multi column combobox width auto resizable

2 posts, 0 answers
  1. Richa Chauhan
    Richa Chauhan avatar
    6 posts
    Member since:
    Jan 2010

    Posted 09 Dec 2010 Link to this post

    I ve the following code for displaying multi column combobox.
    1) I want the table to get automatically resize instead of me setting the width. What should I do to make the table automatically resizable?
    2) Also if I make the width to get the horizontal scrollbar appear, it just moves the data in the table and not the header. What should I do to have the header move?
    <telerik:RadComboBox ID="rcbCategory" Runat="server" DataSourceID="dsCategories" DataTextField="Description" DataValueField="Code" AppendDataBoundItems="true" EmptyMessage="Select category..."Width="200px" DropDownWidth="500px" EnableVirtualScrolling="true" HighlightTemplatedItems="true" MarkFirstMatch="true">
    <HeaderTemplate>
    <table style="width: 480px" cellspacing="0" cellpadding="0">
    <tr>
    <th style="width: 100px;">Code</th>
    <th style="width: 100px;">Description</th>
    <th style="width: 100px;">Division</th>
    <th style="width: 180px;">Department</th>
    </tr>
    </table>
    </HeaderTemplate>
    <ItemTemplate>
    <table style="width: 480px" cellspacing="0" cellpadding="0">
    <tr>
    <td style="width: 100px;"> <%#DataBinder.Eval(Container.DataItem, "Code")%></td>
    <td style="width: 100px;"> <%#DataBinder.Eval(Container.DataItem, "Description")%> </td>
    <td style="width: 100px;"> <%#DataBinder.Eval(Container.DataItem, "Division")%> </td>
    <td style="width: 180px;"> <%#DataBinder.Eval(Container.DataItem, "Dept")%> </td>
    </tr>
    </table>
    </ItemTemplate>
    </telerik:RadComboBox>

     

  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 16 Dec 2010 Link to this post

    Hello Richa Chauhan,

    Let me suggest you take a look at the “Dynamic Dropdown width“  Code Library project where the dropdown width is set upon the databound items text length.

    Best wishes,
    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