Completed
Last Updated: 05 Nov 2014 12:50 by ADMIN
ADMIN
Dimitar
Created on: 29 Oct 2014 10:53
Category: ListView, CardView and CheckedListBox
Type: Bug Report
0
FIX. RadCheckedDropDownList the ItemCheckedChanged event is fired twice.
To reproduce:
- Use the following code to populate the RadCheckedDropDownList http://www.telerik.com/help/winforms/dropdown-and-listcontrol-checkeddropdownlist-databinding.html
- Subscribe to the ItemCheckedChanged event.
- Change the item checked state.

Workaround: 
Add two variables: 
static bool isSync = false; 
bool cancel = false; 

Create custom RadCheckedListVisualItem using the following code snippet: 
class MyVisualItem : RadCheckedListVisualItem
{
    protected override void SynchronizeProperties()
    {
        isSync = true;
        base.SynchronizeProperties();
        isSync = false;
    }
}

Subscribe to CreatingVisualListItem event and set: 
        void radCheckedDropDownList1_CreatingVisualListItem(object sender, Telerik.WinControls.UI.CreatingVisualListItemEventArgs args)
        {
            args.VisualItem = new MyVisualItem();
        }
		
Subscribe to ItemCheckedChanging event and set: 
void radCheckedDropDownList1_ItemCheckedChanging(object sender, Telerik.WinControls.UI.RadCheckedListDataItemCancelEventArgs e)
{
    e.Cancel = cancel;
    cancel = true;

    if (isSync)
    {
        return;
    }
}

Subscribe to ItemCheckedChanged event and set: 
void radCheckedDropDownList1_ItemCheckedChanged(object sender, Telerik.WinControls.UI.RadCheckedListDataItemEventArgs e)
{
    cancel = false;

    if (isSync)
    {
        return;
    }
}
1 comment
ADMIN
Stefan
Posted on: 05 Nov 2014 12:50
We have just issued a new release - Q3 2014 2014.3.1104, which covers this issue and couple more issues important for our customers. For complete list of changes, please refer to our Release Notes (http://www.telerik.com/support/whats-new/winforms/release-history/ui-for-winforms-q3-2014-(version-2014.3.1104)).