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

[Solved] Autocomplete with multicolums problem

2 Answers 109 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 28 Sep 2009, 09:21 PM
I am trying to enable autocomplete for a combobox and I have 2 columns of data.  I use a template for the columns display as show below.  The problem is that the autocomplete is looking at the second column for the autocomplete but I need it on column 1.  It is also populating the data from column 2 when choosing an option, and I need column 1 value.  

I cant seem to figure out how to force the "NAME" column for this.

                  <telerik:RadComboBox HighlightTemplatedItems="true" DropDownWidth="300" ID="cboLeadComp"
                    runat="server" DataSourceID="SqlDataSource3" DataTextField="NAME" DataValueField="ORGANIZATION_ID"
                     Width="260px" CollapseDelay="100" Font-Size="Small" MarkFirstMatch="True" TabIndex="6">
                    <ItemTemplate>
                      <table style="width: 100%" border="0" cellpadding="0" cellspacing="0">
                        <tr style="height: 5px">
                          <td style="width: 50px; height: 5px" nowrap>
                            <%#DataBinder.Eval(Container.DataItem, "Name")%>
                          </td> 
                          <td nowrap style="height: 5px">
                            <%#DataBinder.Eval(Container.DataItem, "Description")%>
                          </td>                       
                        </tr>
                      </table>
                    </ItemTemplate>
                    <HeaderTemplate>
                      <table style="width: 100%">
                        <tr>
                          <td style="width: 50px;height:5px;font-weight:bold">
                            Name</td>
                          <td style="height: 5px;font-weight:bold">
                            Description</td>
                        </tr>
                      </table>
                    </HeaderTemplate>
                  </telerik:RadComboBox>

2 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 29 Sep 2009, 02:05 PM
Hi Robert,

Autocomplete is supposed to look at Text property of the items, so please set DataTextField to the needed column and also note that it's case-sensitive (it should be DataTextField="Name", I guess).

Greetings,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Robert
Top achievements
Rank 1
answered on 29 Sep 2009, 02:22 PM
My fault.  I had some server code setting those values and just realized. 
Tags
ComboBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Yana
Telerik team
Robert
Top achievements
Rank 1
Share this question
or