Home Forums WPF controls Xceed DataGrid for WPF Xceed.Wpf.DataGrid.DataGridException – SetCurrent canno

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22925 |

    I am using the WPF DataGrid in a UserControl along with a few other controls (such as a Comobox). When I set the DataContext and the user clicks on the data grid while it is populating, I get the following exception:

    Xceed.Wpf.DataGrid.DataGridException] {“SetCurrent cannot be invoked while another SetCurrent is in progress.”} Xceed.Wpf.DataGrid.DataGridException

    If they click on another control, it doesn’t occur.

    I tried the following before chaning the ItemsSource, but it still happens:

    if (dataGrid.CurrentItem != null)
    {
    Xceed.Wpf.DataGrid.DataRow row = dataGrid.ItemContainerGenerator.ContainerFromItem(dataGrid.CurrentItem) as Xceed.Wpf.DataGrid.DataRow;
    if (row != null)
    row.EndEdit();
    }
    dataGrid.Columns.Clear();

    Thanks in advance and thanks for filling a huge gap in WPF.

    Imported from legacy forums. Posted by johnvms (had 2452 views)

    Xceed Support
    Member
    Post count: 5658

    Just to be sure, is the exception unhandled? (are your breaking on throw?)

    I need to ask because there is already one knwon reproduction path where is is possible this exception is raised (but explicitly catched within the DataGridControl’s code).

    If not, let me know so I can raise the appropriate bug report.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 3007 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.