MarkFirstMatch + Checkbox Bug

10 posts, 1 answers
  1. Kyle Butler
    Kyle Butler avatar
    26 posts
    Member since:
    Jun 2008

    Posted 21 Jun 2012 Link to this post

    Hi all, I have a RadComboBox that is populated using a SqlDataSource. CheckBoxes="True" and MarkFirstMatch="True". With the checkboxes enabled and the mark first match, the combobox will NOT fire the SelectedIndexChanged event which then determines which items are selected and puts them into a hidden label.

    If i turn MarkFirstMatch off, then it works fine. Anyone else know of this problem and a work around? My users really enjoy using the MarkFirstMatch option and the checkboxes are required in order to select multiple filters from the RadComboBox. There must be something for this bug.

    Thanks in advanced.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Jun 2012 Link to this post

    Hi Kyle Butler,

    Unfortunately I couldn't replicate the issue at my end. Here is the sample code that I tried in version 2012, 2, 607, 40.

    ASPX:
    <telerik:RadComboBox ID="dd" runat="server" AutoPostBack="true"  DataSourceID="SqlDataSource1" CheckBoxes="true" MarkFirstMatch="true"  DataTextField="FirstName" DataValueField="FirstName" onselectedindexchanged="dd_SelectedIndexChanged">
    </telerik:RadComboBox>

    C#:
    protected void dd_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
          //selected index is firing
        }

    Hope this helps.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kyle Butler
    Kyle Butler avatar
    26 posts
    Member since:
    Jun 2008

    Posted 22 Jun 2012 Link to this post

    The Telerik support ticket told me it couldn't be done, what was happening was that the event was firing, but the autopostback wasn't happening due to issues with using both properties at the same time. When the autopostback happens then the datasources typically automatically re-bind. They weren't when making selections AFTER making the first selection due to the MarkFirstMatch and Checkboxes properties being enabled.

    What I did was force databinds for my objects that rely on the current combobox's selected option in the index changed event. I then noticed that the ComboBox fires the selected index changed event even if the user opens the combobox, but doesn't actually make a change. This can be annoying if your comboboxes have a lot of data and take 2-3 seconds to rebind.

    To fix the rebinding when no changes were made I then added an IF statement to the event to determine if any changes actually happened to the selection of checkboxes in the combobox and if there was a change, then rebind, if not then don't do anything. Here's my code.
    Protected Sub rcbCountry_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles rcbCountry.SelectedIndexChanged
            Dim selectedCountriesOld As String = lblSelectedCountries.Text
            lblSelectedCountries.Text = ShowCheckedItems(rcbCountry)
     
            If selectedCountriesOld <> lblSelectedCountries.Text Then
                dsState.DataBind()
                rcbState.DataBind()
     
                dsCity.DataBind()
                rcbCity.DataBind()
            End If
        End Sub
  5. Kyle Butler
    Kyle Butler avatar
    26 posts
    Member since:
    Jun 2008

    Posted 22 Jun 2012 Link to this post

    Actually that's not a fix, it's not working again. It works sometimes and sometimes it doesn't. I was chatting with Dimitar Terziev and he said the next release in a week or two will have this bug fixed.
  6. Answer
    Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 27 Jun 2012 Link to this post

    Hi Kyle,

    Have you tested the latest internal build from yesterday?

    Regards,
    Dimitar Terziev
    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.
  7. Kyle Butler
    Kyle Butler avatar
    26 posts
    Member since:
    Jun 2008

    Posted 27 Jun 2012 Link to this post

    Hey Dimitar, the HotFix seems to be fixing the issue. Thanks!
  8. Kyle Butler
    Kyle Butler avatar
    26 posts
    Member since:
    Jun 2008

    Posted 27 Jun 2012 Link to this post

    Will there ever be support for using the MarkFirstMatch with the CheckBox functionality?
  9. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 28 Jun 2012 Link to this post

    Hello Kyle,

    I'm glad that the problem is resolved. As for the usage of MarkFirstMatch and CheckBoxes I can't give you a certain answer whether this will be implemented, but we shall most certainly consider this request.

    Kind regards,
    Dimitar Terziev
    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.
  10. Shawn Krivjansky
    Shawn Krivjansky avatar
    86 posts
    Member since:
    Jan 2010

    Posted 01 Jul 2012 Link to this post

    Just wanted to throw my 2 cents in on this...

    It's sorta weird when you use the great RadComboBox functionality for a long time and get used to using "MarkFirstMatch" where the user can type along and get to the item(s) they are after, and then you want to implement "checkboxes" and all of a sudden you are screwed.

    You then have to make a choice of which functionality you want more.

    I'm not sure if everybody is having the exact same issues, but mine happen to be after the checkboxes are selected and the user clicks away from the combobox area.  The "selectedvalue" (or whatever is in the "textbox" portion of the control at that point) changes to some random value (maybe it isn't random, but it might as well be).  If you take the code from the Telerik Demo (on checkboxes) and appy "MarkFirstMatch" = true, the problem happens.

    In the configurator demo, they don't even let you turn checkbox/markfirstmatch on at the same time... that tells me bad things are gonna happen.

    Just seems like there should be some way for Telerik to get around this.
    It is a great control with the checkboxes in there, but sacraficing MarkFirstMatch is a tough one to swallow.
  11. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 18 Jul 2012 Link to this post

    Hello Shawn,

    We appreciate your feedback on the matter and as I've mentioned in my previous post this has been forwarded to our development team.

    All the best,
    Dimitar Terziev
    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
UI for ASP.NET Ajax is Ready for VS 2017