This is a migrated thread and some comments may be shown as answers.
RadComboBox are going to be the Death of me
1 Answer 3 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
SSirica asked on 22 Feb 2021, 08:06 PM


I have the following Combobox

<telerik:RadComboBox ID="cbAcctType" runat="server" DataValueField="ACCT_TYPE_ID" DataTextField="acct_code" RenderMode="Classic"
    AutoPostBack="True" CausesValidation="False" Width="100%" DropDownWidth="400px" HighlightTemplatedItems="True"
    InputCssClass="required_cb" EnableLoadOnDemand="true" AppendDataBoundItems="True">
        <asp:Table runat="server" CellPadding="0" CellSpacing="0" Width="100%" GridLines="None">
                <asp:TableCell Width="30%">
                    <%# DataBinder.Eval(Container.DataItem, "acct_code") %>
                <asp:TableCell Width="70%">
                    <%# DataBinder.Eval(Container.DataItem, "acct_description") %>


and I bind it with the following code:

cbAcctType.DataSource = ds.Tables("AcctType")


Sometimes the code associated with an account will expire and no longer be available in the available list, but it still exists so I have to individually retrieve it and add it to the combobox list.  Here is my code for that process

Dim oItem As New RadComboBoxItem
oItem.DataItem = ds.Tables(0).Rows(0)
oItem.Value = ds.Tables(0).Rows(0).Item("ACCT_TYPE_ID").ToString
oItem.Text = ds.Tables(0).Rows(0).Item("acct_code").ToString
oItem.Selected = True


And that's where the wheels come off.  The items is there but only sort of.  It will get selected but there is no items in the list.  and it usually throws and ASPX page error the <%# DataBinder.Eval(Container.DataItem, "acct_code") %> doesn't exist.

What is the piece of the puzzle that's missing?  I have tried it with oItem.DataBind() and that doesn't solve things. 

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 23 Feb 2021, 04:22 PM

I mean what is the purpose of the RadComboBoxItem having a .DataItem property if nothing in the combobox is going to pickup any of the items values?  It should be the single item equivalent of .DataSource.  

I swear people who design these things don't actually use them or design them with the simplest of scenarios.  Don't even get me started on the  RadMultiColumnComboBox.  That should have been released with an Alpha version warning. It's like the RadComboBox, but almost nothing is the same.  It's a Fiero with a Ferrari body.  

Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question