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

Have Multi column combobox width auto resizable

1 Answer 218 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Richa Chauhan
Top achievements
Rank 1
Richa Chauhan asked on 09 Dec 2010, 11:31 PM
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>

 

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 16 Dec 2010, 01:07 PM
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.
Tags
ComboBox
Asked by
Richa Chauhan
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or