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

show multi columns in input area?

1 Answer 42 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
matt
Top achievements
Rank 1
matt asked on 16 Oct 2008, 04:46 PM
hello,

i have a RadComboBox that uses multiple columns:

<Telerik:RadComboBox ID="rcbSignals" DataValueField="SignalTypeID" DataTextField="Code" Width="230" DropDownWidth="400" ShowToggleImage="true" Filter="Contains" AllowCustomText="True" MarkFirstMatch="true" HighlightTemplatedItems="true" skin="Gray" OnClientFocus="showDropDown" runat="server"
    <ItemTemplate> 
        <%# DataBinder.Eval(Container.DataItem, "Code")%> - <%# DataBinder.Eval(Container.DataItem, "Description")%> 
    </ItemTemplate> 
</Telerik:RadComboBox> 

...question -- after a user makes a selection, how do i show both its columns in the text input area? currently only the column designated in the DataTextField property is showing up.


thanks,
matt

1 Answer, 1 is accepted

Sort by
0
matt
Top achievements
Rank 1
answered on 20 Oct 2008, 03:54 PM
the only way ive found to do this is by using code-behind:

protected void rcbSignals_ItemDataBound(object sender, RadComboBoxItemEventArgs e) 
    DataRowView rowView = (DataRowView)e.Item.DataItem; 
 
    e.Item.Text = String.Format("{0} - {1}", rowView["Code"].ToString(), rowView["Description"].ToString()); 


matt



Tags
ComboBox
Asked by
matt
Top achievements
Rank 1
Answers by
matt
Top achievements
Rank 1
Share this question
or