FlexPivot exception when updating DataSource (SelectedIndex)

Posted by: pkowalski on 21 December 2021, 11:45 am EST

  • Posted 21 December 2021, 11:45 am EST - Updated 3 October 2022, 1:45 pm EST


    We’re seeing an exception every time we update DataSource on FlexPivot, it happens in the demo app as well. The exception is being caught by FirstChanceException handler which we use to monitor all exceptions in our application and this is creating a lot of noise. Would it be possible to suppress it by any chance?

    Please find your FlexPivot demo app modified to show the exception, using 4.5.20213.532 nuget packages on .NET Framework 4.8

    Many thanks,



  • Posted 21 December 2021, 3:29 pm EST


    In the sample you provided, you are using the FirstChanceException event to get notified of the exceptions and show a message, the event gets fired before the exception handlers have had a chance to handle the exceptions.

    For more info on FirstChanceException, you can refer the following links:

    We suggest you either use the UnhandledException event of the AppDomain to get notifications for the unhandled exceptions or do not show a MessageBox in the FirstChanceException event and log the exceptions instead.

    Please refer to the sample attached.




  • Posted 21 December 2021, 4:08 pm EST

    Yes we’re using the other handlers a well but we have to continue using FirstChanceException due to the nature of our application. Unfortunately this exception doesn’t contain any C1-specific entries in the StackTrace so it’s not easy to filter it out without the risk of missing other legitimate ones. We use a lot of C1 components and this is the only scenario where we are seeing an exception like this so we were hoping it could be avoided.

  • Posted 22 December 2021, 10:39 pm EST


    We have escalated this case to the development team to get their insights on the issue. We will let you know when we have an update.




  • Posted 23 December 2021, 3:09 pm EST


    As per the development team, you can use the code given below to filter out the exceptions.

    private static void CurrentDomain_FirstChanceException(object sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e)
    string myName = Assembly.GetExecutingAssembly().GetName().Name;
    StackFrame[] frames = new StackTrace().GetFrames();
    for (int i = 1; i < frames.Length; i++)
    string name = frames[i].GetMethod().Module.Name;
    if (name.StartsWith("C1."))
    if (name.StartsWith(myName))
    { MessageBox.Show(e.Exception.ToString(), "Exception caught!", MessageBoxButtons.OK); break; }

    If you need any other help, just let us know.



  • Posted 4 January 2022, 12:46 pm EST

    Thank you for the suggestion, we’ve found that extracting the full StackTrace object has a performance penalty and in case of our realtime application this exception can happen multiple times per second as we keep updating the pivot, hence it’s not a workaround we’re very comfortable with. We will use a simpler filter for the time being but if you would consider suppressing this exception altogether in a future release we’d appreciate it.

  • Posted 4 January 2022, 8:42 pm EST


    We have escalated the case to the development team to get their insights on this and will let you know as soon as we have an update.



  • Posted 25 April 2023, 8:25 pm EST


    Apologies for the delayed response. As per the development team, It would not be possible since the FirstChanceException event is notifying before the try-catch has got the chance to handle and suppress these exceptions.


Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels