Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
Exception in Infragistics2.Shared.v10.1.dll
posted

 

When I am refreshing a databinding on a grid I am getting a;

A first chance exception of type 'System.ArgumentException' occurred in Infragistics2.Shared.v10.1.dll

A message box pops up that says "Key Already Exists Paramater Name: Key

The first time I set the databinding it works fine and show the rows, if i try to set it again it blows up. I have tried setting it to nothing first but that didnt work. Its just a simple refresh because the list its bound to may have added or removed rows.

How do I troubleshoot this?

 

 

 

Parents
  • 17259
    Offline posted

    I think refreshing like that is not necessary. If you bind a list to the grid and add or delete items, the grid should show the changes. However, not any list supports that, and more specifically, only IBindingList does.

    Instead of binding your list directly do this:

    var bindingList = new BindingList<myEntity>(myEntitylist);

    grid.DataSource = bindingList;

    Now any delete or insert in your original list should immediately be seen on the grid.

    If you still want to refresh manually, just call grid.Rows.Refresh(RefreshRow.ReloadData);

Reply Children