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

Service side code for multi-column combobox

1 Answer 63 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
dhuss
Top achievements
Rank 1
dhuss asked on 11 Sep 2012, 06:37 PM
I know how to load a new item into a radCombobox, but how do you do it for a multi-column combobox? This is my code for the combobox:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="radCBOLookup.ascx.vb"
    Inherits="HEW.radCBOLookup" %>
<telerik:RadComboBox ID="radCBOLookup" runat="server" MarkFirstMatch="true" AllowCustomText="false"
    Width="50px" DropDownWidth="350px" MaxHeight="300px" NoWrap="true" HighlightTemplatedItems="true"
    ExpandDirection="Down" ExpandDelay="0" CollapseDelay="0">
    <HeaderTemplate>
        <table style="width: 100%; text-align: left; font-size: 8pt">
            <tr>
                <td style="width: 20%;">
                    Code
                </td>
                <td style="width: 80%;">
                    Description
                </td>
            </tr>
        </table>
    </HeaderTemplate>
    <ItemTemplate>
        <table style="width: 100%; text-align: left; font-size: 8pt">
            <tr>
                <td style="width: 20%;">
                    <%#DataBinder.Eval(Container.DataItem, "Master_Type_Code")%>
                </td>
                <td style="width: 80%;">
                    <%#DataBinder.Eval(Container.DataItem, "Master_Desc")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</telerik:RadComboBox>

VB code for radCBOLookup_ItemDataBound:
e.Item.Text = (DirectCast(e.Item.DataItem, DataRowView))("Master_Type_Code").ToString
 
e.Item.Value = (DirectCast(e.Item.DataItem, DataRowView))("Master_Type_Code").ToString.Trim
 
e.Item.Attributes("Description") = (DirectCast(e.Item.DataItem, DataRowView))("Master_Desc").ToString.Trim


Currently, the only way I have been able to figure this out is to add a new datarow to the datasource. Does anyone have any suggestions?

1 Answer, 1 is accepted

Sort by
0
Accepted
Kalina
Telerik team
answered on 17 Sep 2012, 11:37 AM
Hi dhuss,

Let me suggest you take a look at this help article.

Regards,
Kalina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
dhuss
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or