Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Combobox > Multi-Column RadComboBox with AutoComplete
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Answered Multi-Column RadComboBox with AutoComplete

Feed from this thread
  • Nicolas avatar

    Posted on Jun 9, 2010 (permalink)

    Hi everyone,

    I'm trying to implement a multi-columns RadComboBox in which I must be able to implement those two specific behaviors:
    1. When using the auto-complete feature, the combobox should consider text within all columns of the multi-columns RadComboBox when filtering the items.
    2. When the user select an item from the comboBox, only the text within the first column should be displayed.

    So far, I can only manage to achieve #1 or #2 but not both at the same time.

    Here's my RadComboBox declaration
    <telerik:RadComboBox ID="cboSystemId" runat="server"  
        AllowCustomText="true" 
        AutoPostBack="true"  
        DropDownWidth="450px"  
        EmptyMessage="Choose a System ID" 
        EnableTextSelection="true" 
        Filter="Contains" 
        Height="200px"  
        HighlightTemplatedItems="true" 
        MarkFirstMatch="true"  
        OnSelectedIndexChanged="cboSystemId_SelectedIndexChanged" 
        Skin="Vista" 
        Width="200px" > 
        <HeaderTemplate> 
            <table style="font-size:10px"
                <tr> 
                    <td style="width: 140px;">System ID</td> 
                    <td style="width: 200px;">System Name</td> 
                    <td style="width: 75px;">Product</td> 
                    <td style="width: 25px;">Version</td> 
                </tr> 
            </table> 
        </HeaderTemplate> 
        <ItemTemplate> 
            <table style="font-size:9px"
                <tr> 
                    <td style="width: 140px;"
                        <%# DataBinder.Eval(Container, "Attributes['SerialNumber']")%> 
                    </td> 
                    <td style="width: 200px;"
                        <%# DataBinder.Eval(Container, "Attributes['SystemName']")%> 
                    </td> 
                    <td style="width: 75px;"
                        <%# DataBinder.Eval(Container, "Attributes['Product']")%> 
                    </td> 
                    <td style="width: 25px;"
                        <%# DataBinder.Eval(Container, "Attributes['Version']")%> 
                    </td> 
                </tr> 
            </table> 
        </ItemTemplate> 
    </telerik:RadComboBox> 

    And here's the code for the binding.
    foreach (DataRow dr in data.Rows) 
        var item = new RadComboBoxItem 
        { 
            Text = dr["SerialNumber"].ToString() /*+ @" " + dr["SystemName"]*/,  
            Value = dr["SerialNumber"].ToString() 
        }; 
     
        item.Attributes.Add("SerialNumber", dr["SerialNumber"].ToString()); 
        item.Attributes.Add("SystemName", dr["SystemName"].ToString()); 
        item.Attributes.Add("Product", dr["Product"].ToString()); 
        item.Attributes.Add("ProductId", dr["ProductId"].ToString()); 
        item.Attributes.Add("Version", dr["Version"].ToString()); 
        item.Attributes.Add("VersionId", dr["VersionId"].ToString()); 
     
        cboSystemId.Items.Add(item); 
        item.DataBind(); 

    Any help would be appreciate, Thanks

    Nick

  • Answer Yana Yana admin's avatar

    Posted on Jun 14, 2010 (permalink)

    Hello Nicolas,

    I've modified your code in order to fulfill both the requirements, please download the attached code and give it a try.

    Greetings,
    Yana
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Attached files

  • Nicolas avatar

    Posted on Jun 15, 2010 (permalink)

    Thanks Yana,

    Your solution was exactly what I was looking for. (thumbs up for telerik team).

    Nicolas

  • Posted on Apr 14, 2011 (permalink)

    Create Multi Column RadComboBox in code

    if anyone is searching:
    http://andrewwhitten.wordpress.com/2010/05/15/multiple-select-telerik-radcombobox-in-code-behind/

    This is working for me with RadComboBox 2011 Q1.

     Regards, 

    Erik

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Combobox > Multi-Column RadComboBox with AutoComplete