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

MarkFirstMatch + Checkbox Bug

9 Answers 114 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kyle Butler
Top achievements
Rank 2
Kyle Butler asked on 21 Jun 2012, 08:29 PM
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.

9 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Jun 2012, 07:01 AM
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.
0
Kyle Butler
Top achievements
Rank 2
answered on 22 Jun 2012, 01:37 PM
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
0
Kyle Butler
Top achievements
Rank 2
answered on 22 Jun 2012, 05:22 PM
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.
0
Accepted
Dimitar Terziev
Telerik team
answered on 27 Jun 2012, 07:19 AM
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.
0
Kyle Butler
Top achievements
Rank 2
answered on 27 Jun 2012, 01:43 PM
Hey Dimitar, the HotFix seems to be fixing the issue. Thanks!
0
Kyle Butler
Top achievements
Rank 2
answered on 27 Jun 2012, 02:27 PM
Will there ever be support for using the MarkFirstMatch with the CheckBox functionality?
0
Dimitar Terziev
Telerik team
answered on 28 Jun 2012, 06:09 AM
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.
0
Shawn Krivjansky
Top achievements
Rank 1
answered on 01 Jul 2012, 06:07 AM
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.
0
Dimitar Terziev
Telerik team
answered on 18 Jul 2012, 08:45 AM
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.
Tags
ComboBox
Asked by
Kyle Butler
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Kyle Butler
Top achievements
Rank 2
Dimitar Terziev
Telerik team
Shawn Krivjansky
Top achievements
Rank 1
Share this question
or