Click here to Skip to main content
15,885,056 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Developers,
i am binding comboBox in telerik, it binds well and while running the application it display the items bound on that combobox when user clicks first but when once he select any item and after that if he again click on the ComboBox it wont show all items rather its showing only the previous selected item.

My Code is-

XML
<telerik:RadComboBox ID="rcbSearch" runat="server" CausesValidation="false"
            AutoPostBack="true" Width="160px"
            EmptyMessage="Select the Search Criteria" DropDownWidth="200px" HighlightTemplatedItems="true"
                            EnableLoadOnDemand="true"  Filter="StartsWith"
            OnItemsRequested="rcbSearch_ItemsRequested" Skin="Web20"
            onselectedindexchanged="rcbSearch_SelectedIndexChanged">
                            <HeaderTemplate>
                                <table style="width: 200px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td align="left" style="width: 20px;">
                                            Code</td>
                                        <td align="left" style="width: 60px;">
                                            Description</td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table style="width: 200px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td align="left" style="width: 20px;">
                                            <%# DataBinder.Eval(Container, "Text")%>
                                        </td>
                                        <td align="left" style="width: 60px;">
                                            <%# DataBinder.Eval(Container, "Attributes['Description']")%>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </telerik:RadComboBox>



Code Behind--

XML
protected void rcbSearch_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
   fnbindComboBox();
}
#endregion
private void fnbindComboBox()
{
    DataTable dtTableDetails = new DataTable();
    _objAction = new DALSdfAction();
    dtTableDetails = _objAction.getTableDetails("sdfAction");

    foreach (DataRow dr in dtTableDetails.Rows)
    {
        RadComboBoxItem item = new RadComboBoxItem();
        item.Text = dr["sdfActionID"].ToString();
        string description = dr["dsc"].ToString();
        item.Attributes.Add("Description", description);
        rcbSearch.Items.Add(item);
        item.DataBind();
    }
}


Kindly help if you have some experience to Solve this issue.
Thanku.
Posted

1 solution

For questions on 3rd party control, try here: Telerik Forum[^]

Also look at these:
Telerik - Documentation[^]
Telerik - Online Demos[^]
 
Share this answer
 
Comments
The Doer 22-Jul-12 2:56am    
thanks, Where to post my question??
Sandeep Mewara 22-Jul-12 3:43am    
First link of forum?
obviously you need to create your username there.

To be exact specific link: https://www.telerik.com/login.aspx?ReturnUrl=%2fcommunity%2fforums%2fnew-thread.aspx%3fforumId%3d248

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900