XlsxFormatProvider and busyindicator

4 posts, 0 answers
  1. Leonard
    Leonard avatar
    22 posts
    Member since:
    Jan 2013

    Posted 18 Jun 2015 Link to this post

    Good morning, 

     I have the following code

                Document = null;
                IWorkbookFormatProvider provider = new XlsxFormatProvider();
                var openDialog = new OpenFileDialog
                    {
                        Multiselect = false,
                        Filter = GetExtension()
                    };
                bool? dialogResult = openDialog.ShowDialog();
                string fileName = string.Empty;
                if (dialogResult == true)
                {
                    try
                    {
                        using (Stream stream = openDialog.File.OpenRead())
                        {
                            Messenger.Default.Send(new ProgressBar(true));
                            
                            Document = provider.Import(stream);
                            fileName = openDialog.File.Name;
                            
                            Messenger.Default.Send(newProgressBar(false));
                        }
                    }
                    catch (Exception e)
                    {
                        Error = e.Message;
                    }
                    
                }
                FileName = fileName;

     

    when I import a file I get an error about thrads in same line.

    How can I show a busyindicator while is importing?

    Thanks.

  2. Anna
    Admin
    Anna avatar
    99 posts

    Posted 22 Jun 2015 Link to this post

    Hello,

    Both the progress bar and the format provider use the UI thread and, unfortunately, this means that showing a progress bar during import is not possible at this stage.

    Regards,
    Anna
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Sergey
    Sergey avatar
    23 posts
    Member since:
    Oct 2011

    Posted 20 Aug 2015 in reply to Anna Link to this post

    Is there any plans on resolving this? Very small file Import takes about 1 second. It very quickly might become a problem.

    Using BackGroundWorker isn't helping either as it throws cross thread exception.

  5. Anna
    Admin
    Anna avatar
    99 posts

    Posted 25 Aug 2015 Link to this post

    Hi Sergey,

    Do you think that you could open a support ticket and send us the file with which you reproduce this behavior so that we can investigate? A whole second indeed sounds like a long time for a small file. Moreover, you should be able to use a background worker for the import with the last version of RadSpreadsheet, so if you could send us the code throwing the cross thread exception it would also be really helpful.

    Regards,
    Anna
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top