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

RadCombo with <ItemTemplate> and ObjectData Source - selected value displays type name

2 Answers 31 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 05 Jun 2015, 10:52 PM

My List is displaying correctly and filtering correctly however when selecting item all that is selected is the type name ??
  

<telerik:RadComboBox ID="rcbEmployeeFilter" AllowCustomText="True" runat="server"
               Width="200px" Height="400px"
                 
               DataValueField="empID"
               DataSourceID="odsEmployees"
               EmptyMessage="Search for people..."
               ResolvedRenderMode="Classic"
                
               >
               <ItemTemplate>
                   <%# DataBinder.Eval(Container.DataItem, "empID")%> -
                   <%# DataBinder.Eval(Container.DataItem, "empFirstName")%> <%# DataBinder.Eval(Container.DataItem, "empLastName")%>
               </ItemTemplate>
           </telerik:RadComboBox>
            
           <asp:ObjectDataSource ID="odsEmployees" runat="server"
           SelectMethod="GetEmployees"
           TypeName="PMTReports.BLL.Person.Employee" OldValuesParameterFormatString="original_{0}"
           >
 
       </asp:ObjectDataSource>

 Please tell me what I am missing or what to change?

 

2 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 10 Jun 2015, 08:22 AM
Hi Dan,

Please set the DataTextField property. 

Regards,
Peter Filipov
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Dan
Top achievements
Rank 1
answered on 10 Jun 2015, 03:57 PM

Peter,

 Thanks for the reply, Yes, I have tried that but as you must know. Telerik DataTextField will only accept one parameter(field). Simply I putting empLastname or empID will not be enough for the user to know that they picked the right item.
Since there was no good solution I have since created a new object type PMTReports.BLL.Person.EmployeeBasic  that  provides the entire name empFullName in one parameter, and I have abandeded the <itemTemplate>

 

 

 

Tags
ComboBox
Asked by
Dan
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Dan
Top achievements
Rank 1
Share this question
or