1

I have a RadComboBox like so:

            <telerik:RadComboBox ID ="productsDropDown" DataValueField="DisplayName" DataTextField="DisplayName" HighlightTemplatedItems="true"
            runat="server" AllowCustomText="true" Height="150px" Width="200px" OnClientDropDownClosed="onDropDownProductClose" AutoPostBack="true">
                <ItemTemplate>
                    <div onclick="StopPropagation(event)">
                        <asp:CheckBox runat="server" ID="chk2" Checked="false" onclick="onCheckBoxProductClick(this)"/>
                        <asp:Label runat="server" ID="Label2" AssociatedControlID="chk2">
                            <%# Eval("DisplayName")%>
                        </asp:Label>
                    </div>
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Button ID="btnSubmitProduct" runat="server" Text="OK" OnClick="OnSubmitProduct" />
                </FooterTemplate> 
            </telerik:RadComboBox>

but for some reason it won't display any of the data I bind to it like so:

            productsDropDown.DataSource = FTSAppLogic.getProducts();
            productsDropDown.DataBind();

I have a nearly identical drop down like this:

            <telerik:RadComboBox ID ="regionsDropDown" DataValueField="Region" DataTextField="Region" HighlightTemplatedItems="true"
            runat="server" AllowCustomText="true" Height="150px" Width="200px" OnClientDropDownClosed="onDropDownRegionClosing" AutoPostBack="true">
                <ItemTemplate>
                    <div onclick="StopPropagation(event)">
                        <asp:CheckBox runat="server" ID="chk1" Checked="false" onclick="onCheckBoxRegionClick(this)"/>
                        <asp:Label runat="server" ID="Label1" AssociatedControlID="chk1">
                            <%# Eval("Region")%>
                        </asp:Label>
                    </div>
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Button ID="btnSubmitRegion" runat="server" Text="OK" OnClick="OnSubmitRegion" />
                </FooterTemplate> 
            </telerik:RadComboBox>



            regionsDropDown.DataSource = FTSAppLogic.getRegions();
            regionsDropDown.DataBind();

and it displays everything perfectly (and both of their get functions are nearly identical, returning same layout and same data type)

Also to make matters weirder, I've thrown a debug break in and found that after the data is bound to the productDropDown, the data is in fact bound, it just will not display any of it..

anyone have any ideas why?! I'm at a complete loss!!

RogueSpear00
  • 619
  • 2
  • 9
  • 24
noneabove
  • 89
  • 2
  • 12

1 Answers1

0

I think u have used the label in wrong way in item template:

<asp:Label runat="server" ID="Label1" AssociatedControlID="chk1">
         <%# Eval("Region")%>//this is wrong 
</asp:Label>

It should be:

<asp:Label runat="server" ID="Label1" AssociatedControlID="chk1" 
Text='<%# Eval("Region")%>'</asp:Label>

U need to assign the data column to the text field of label it is asp control(not like HTML label).

Somnath Kharat
  • 3,570
  • 2
  • 27
  • 51