Service side code for multi-column combobox

2 posts, 1 answers
  1. dhuss
    dhuss avatar
    120 posts
    Member since:
    Sep 2009

    Posted 11 Sep 2012 Link to this post

    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?
  2. Answer
    Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 17 Sep 2012 Link to this post

    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.
Back to Top