Enter Key causes AccessViolationException

5 posts, 0 answers
  1. Chris
    Chris avatar
    51 posts
    Member since:
    Sep 2010

    Posted 20 Dec 2010 Link to this post

    Hi,

    I have a RadMenuItem that when clicked displays a SaveFileDialog in order for the user to export and save the contents of a RadGridView. If the event handler is called due to the user hitting the Enter key then an AccessViolationException memory exception is thrown attempting to read the DialogResult property:

    var saveFileDialog = new SaveFileDialog
                {
                    DefaultExt = extension,
                    Filter = string.Format("{0} files (*.{1})|*.{1}|All files (*.*)|*.*", format, extension),
                    FilterIndex = 1
                };
      
                if (saveFileDialog.ShowDialog() == true)
                {
                    using (Stream fileStream = saveFileDialog.OpenFile())
                    {
                        this.GridView.Export(fileStream, new GridViewExportOptions
                        {
                            Format = format1,
                            ShowColumnFooters = true,
                            ShowColumnHeaders = true,
                            ShowGroupFooters = false
                        });
                    }
                }

    The if (saveFileDialog.ShowDialog() == true) produces the following exception:

    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    Any ideas why this might be occuring?

    Regards,
    Chris
  2. Chris
    Chris avatar
    51 posts
    Member since:
    Sep 2010

    Posted 21 Dec 2010 Link to this post

    To add to this, it doesn't make any difference how the event handler is registered i.e. CommandBinding or simple Click handler, this behaviour is consistent and will always throw the AccessViolationException.

    It does not appear this error can be handled and will always crash the application.

    A fix or workaround would be greatly appreciated.

    Regards,
    Chris
  3. DevCraft banner
  4. George
    Admin
    George avatar
    1332 posts

    Posted 23 Dec 2010 Link to this post

    Hi Chris,

    We are not aware of such issue with RadContextMenu control. Could you please give us the callstack? Also, we will greatly appreciate a sample project of yours. It will definitely help us in further pinpointing and resolving the problem. Can you attach the sample project to the support ticket?

    I am glad to assist you further.

    Regards,
    George
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  5. Chris
    Chris avatar
    51 posts
    Member since:
    Sep 2010

    Posted 23 Dec 2010 Link to this post

    Hi George,

    We have raised a support ticket regarding this issue and I have just attached a sample project to the support ticket. I have attached it here also.

    Kind Regards,
    Chris

    Just tried to attach, but zip files are not allowed in the forums. Please see the support ticket raised under the account for Simon Allen for the sample project.
  6. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 27 Dec 2010 Link to this post

    Hi Chris,

    Thanks for the cooperation and sending the project as well.

    Kind regards,
    Kaloyan
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top
DevCraft banner