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

[Solved] radCombobox Not Doing Postback after items list is empty

3 Answers 189 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Joshua Wise
Top achievements
Rank 1
Joshua Wise asked on 11 Dec 2009, 03:35 PM
Hi all,

I have a radCombobox that I'm loading with data on the ItemsRequested method.  I'm using a stored procedure to grab data that is "%like%" the text the user types in.  This works great...until what they have typed no longer returns any records.  Once this is the case, no matter what they do, backspace, exit the control and return, the control stops executing the ItemsRequested method.  There is no postback, no attempt to run the method on the server side.

I'm including the code of my combobox and my ItemsRequested method.

I tried to apply the fix found here from my post here but with no success.

So, can anyone help with this?  

Thanks,
Joshua Wise

HTML Script:

<telerik:RadComboBox runat="server" ID="radAccount" DropDownWidth="400px" EnableVirtualScrolling="True" 
            Height="150px" AllowCustomText="true" MarkFirstMatch="true" 
            Skin="WebBlue" OnItemsRequested="radAccount_ItemsRequested" OnSelectedIndexChanged="radAccount_SelectedIndexChanged" 
            EnableLoadOnDemand="true"  OnTextChanged="radAccount_TextChanged"  
            AutoPostBack="True"
            <ItemTemplate> 
                <table class="ComboBoxTable"
                    <tr> 
                        <td class="LeftCellComboBox"
                            <%# DataBinder.Eval(Container, "Attributes['acctcat']")%> 
                        </td> 
                        <td class="LeftCellComboBox"
                            <%# DataBinder.Eval(Container, "Attributes['Description']")%> 
                        </td> 
                    </tr> 
                </table> 
            </ItemTemplate> 
            <CollapseAnimation Type="OutQuint" Duration="1"></CollapseAnimation> 
        </telerik:RadComboBox> 



Server Side C# Code

 protected void radAccount_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) 
    { 
 
        DataRow[] data = GetData(e.Text); 
 
 
        e.EndOfItems = endOffset == data.Count(); 
 
        radAccount.Items.Clear(); 
 
 
 
        for (int i = 0; i < data.Count(); i++) 
        { 
 
            RadComboBoxItem item = new RadComboBoxItem(); 
 
            item.Text = (string)data[i]["acctcat"]; 
            item.Value = data[i]["acctcat"].ToString(); 
 
            item.Attributes.Add("acctcat", data[i]["acctcat"].ToString()); 
            item.Attributes.Add("Description", data[i]["Description"].ToString()); 
 
            radAccount.Items.Add(item); 
 
            item.DataBind(); 
        } 
 
        //e.Message = GetStatusMessage(endOffset, data.Rows.Count); 
 
 
 
 
    } 

In this I get an array of DataRows which I then add attributes to for the control.





   

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 14 Dec 2009, 03:38 PM
Hi Joshua Wise,

Your issue is most probably the one described in the forum sticky you mentioned, so the workaround there is valid.

Did you apply the fix or your RadComboBox is still not working after doing that?

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Joshua Wise
Top achievements
Rank 1
answered on 14 Dec 2009, 08:02 PM
Yes, I tried that, and it's still not working.  
0
Simon
Telerik team
answered on 17 Dec 2009, 04:52 PM
Hello Joshua Wise,

Your RadComboBox definition and code look fine, so there must be something else causing the issue.

Can you upgrade to the latest version of Telerik.Web.UI and see whether it fixes the issue on your side?

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Joshua Wise
Top achievements
Rank 1
Answers by
Simon
Telerik team
Joshua Wise
Top achievements
Rank 1
Share this question
or