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

Item Has Already Been Added Error

2 Answers 45 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gohar
Top achievements
Rank 1
Gohar asked on 17 Dec 2015, 11:02 AM

From filtering box, when I select Null and then select All then the following error occurs:

Item has already been added. Key in dictionary: '(Blanks)'  Key being added: '(Blanks)'

Please see the attached screenshot.

2 Answers, 1 is accepted

Sort by
0
Raphaël MANSUY
Top achievements
Rank 1
answered on 15 Mar 2016, 03:16 PM

Hi,

I have exactly the same issue.

I've tried with the last version (2016 Q1) and I still have the problem.

Is there a workaround available ?

 

Thank you in advance

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Mar 2016, 01:19 PM
Hello Raphaƫl,

Thank you for writing.

I have logged it in our feedback portal. You can track its progress, subscribe status changes and add your vote/comment to it on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to remove the unchecked node values from the dictionary: 

this.radGridView1.FilterPopupInitialized += radGridView1_FilterPopupInitialized;
 
RadListFilterDistinctValuesTable selectedValues;
 
private void radGridView1_FilterPopupInitialized(object sender, Telerik.WinControls.UI.FilterPopupInitializedEventArgs e)
{
    RadListFilterPopup popup = e.FilterPopup as RadListFilterPopup;
    selectedValues = popup.MenuTreeElement.SelectedValues;
    popup.MenuTreeElement.TreeView.NodeCheckedChanged += TreeView_NodeCheckedChanged;
}
 
private void TreeView_NodeCheckedChanged(object sender, TreeNodeCheckedEventArgs e)
{
    if (e.Node.CheckState == Telerik.WinControls.Enumerations.ToggleState.Off)
    {
        if (selectedValues.Contains(e.Node.Text))
        {
            selectedValues.Remove(e.Node.Text);
        }
    }
}

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Gohar
Top achievements
Rank 1
Answers by
Raphaël MANSUY
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or