Combo is clearing the text when using Checkbox and LoadOnDemand

7 posts, 0 answers
  1. Alfredo Buoncompagno
    Alfredo Buoncompagno avatar
    4 posts
    Member since:
    Jul 2009

    Posted 10 Nov 2011 Link to this post

    Hi !!
    The scenario is this:

    RadComboBox with LoadOnDemand="True".
    The user starts inputing some text, and the combo load the results when the ItemRequestTimeout is reached.
    The input text is still in the combo, even before the combo load the results, so the user can continue to input more text, or change parts of it, etc. The combo keeps making the searches and everything works perfect.

    The problem is that when I enable the CheckBoxes="True", everytime the combo makes a search to load the results, it clear the user's inputed text, and the user cannot keep inputing more text.

    Can i keep the user's text in the combo with CheckBoxes = true ?

    Thank's
  2. Dariusz
    Dariusz avatar
    35 posts
    Member since:
    Jul 2010

    Posted 15 Nov 2011 Link to this post

    Important for me too...

    I am holding selected values in a ViewState variable so I wonder if I could somehow using Javascript code change the text so there are selected elements.

    I use my RadComboBox with Checkbox as a FilterTemplate.

    Currently when I check some items - the RadGrid do refresh and I have proper results. But my combo is cleared and all items are unchecked. I do check them by using :

    protected void RadComboBox1_ItemDataBound(object o, RadComboBoxItemEventArgs e)
            {
                List<string> linie = new List<string>();
                foreach (KeyValuePair<string, object> obiekt in Filtry)
                {
                    if (obiekt.Key == "linia")
                    {
                        string[] tmp = obiekt.Value.ToString().Split(',');
                        foreach (string lin in tmp )
                            linie.Add(lin.TrimEnd().TrimStart());
                        break;
                    }
                }
                if (linie.Contains(e.Item.Text))
                    e.Item.Checked = true;
            }
    Filtry is my list of filters I used in RadGrid so I can access them in other events. I'm looking for data for "linia" as its the combo with checkboxes.

    But now because combo is cleared - when I want to uncheck those items - first click makes the text appear again, second click - makes the text disappear and only then the checkbox is not checked. Very very strange :/
  3. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 15 Nov 2011 Link to this post

    Hello,

    I am afraid that simultaneous usage of RadComboBox CheckBoxes feature and Load On Demand is not a supported scenario.
    The RadComboBox items loaded with Load On Demand are not accessible on server-side. However the CheckBoxes feature needs to access the checked RadComboBox items at server-side.
    Additionally when CheckBoxes is enabled – the user is not supposed to type in control input because the text in the input is set explicitly when a RadComboBox item is checked.

    Please find more details about CheckBoxes feature this 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
  4. Dariusz
    Dariusz avatar
    35 posts
    Member since:
    Jul 2010

    Posted 15 Nov 2011 Link to this post

    Hello Kalina,

    how about setting the text of combobox from clientSide by getting the text from ViewState? How can we do that? We can get checked items from the SelectedIndexChanged event. So then, after postback we still have those items in ViewState. I used it already to check same items after postback but my only problem is setting the combo text. I guess we can do it with javascript but I don't know it.
  5. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 17 Nov 2011 Link to this post

    Hello,

    I am afraid that setting the RadComboBox input text when CheckBoxes feature is enabled is not a supported scenario.
    Please avoid usage of Load On Demand along with the CheckBoxes feature.   

    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
  6. Alfredo Buoncompagno
    Alfredo Buoncompagno avatar
    4 posts
    Member since:
    Jul 2009

    Posted 17 Nov 2011 Link to this post

    Hi Kalina,

    I can't avoid the usage of the LoadOnDemand, because the list os itens could have more than 20.000 of itens, so the search by description is necessary and it's really useful for the users.

    One thing I don't understand is why, when the combo uses the CheckBox Option it has to clear the text after a loadondemand, if it doesn't has any item checkd......why it needs to clear the inputed text ?!

    Did you have any suggestion to use the RadCombo with LoadOnDemand and multiple itens selection ?

    Thank's
  7. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 22 Nov 2011 Link to this post

    Hello Alfredo Buoncompagno,

    I understand your point.
    You are dealing with an enormous number of items and I am afraid that even with Load On Demand this will slow down the performance of your page.

    The best that I can suggest you is to implement the checkboxes within the RadComboBox ItemTemplate – as is demonstrated at this online demo.

    Best wishes,
    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