Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. dialogs must be user-initiated silverlight 4

dialogs must be user-initiated silverlight 4

Scheduled Pinned Locked Moved WPF
helpgraphicssysadminquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NTheOne
    wrote on last edited by
    #1

    Hello, While exporting the telerik chart to PNG image format, I received below mentioned error message. dialogs must be user-initiated. Perhaps the image is saved successfully. Can any one can help me why I got this type of error message? Here is my code: try { SaveFileDialog dialog = new SaveFileDialog(); dialog.DefaultExt = ".png"; dialog.Filter = "Portable Network Graphics (*.png)|*.png"; bool? showDialog = dialog.ShowDialog(); if (showDialog == true) { Stream fileStream = dialog.OpenFile(); MainChart.ExportToImage(fileStream, new Telerik.Windows.Media.Imaging.PngBitmapEncoder()); fileStream.Close(); } }

    P A 2 Replies Last reply
    0
    • N NTheOne

      Hello, While exporting the telerik chart to PNG image format, I received below mentioned error message. dialogs must be user-initiated. Perhaps the image is saved successfully. Can any one can help me why I got this type of error message? Here is my code: try { SaveFileDialog dialog = new SaveFileDialog(); dialog.DefaultExt = ".png"; dialog.Filter = "Portable Network Graphics (*.png)|*.png"; bool? showDialog = dialog.ShowDialog(); if (showDialog == true) { Stream fileStream = dialog.OpenFile(); MainChart.ExportToImage(fileStream, new Telerik.Windows.Media.Imaging.PngBitmapEncoder()); fileStream.Close(); } }

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Where are you calling this code from? Silverlight expects the SaveFileDialog to be instantiated from a user initiated event (such as responding to a Button.Click).

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      N 1 Reply Last reply
      0
      • P Pete OHanlon

        Where are you calling this code from? Silverlight expects the SaveFileDialog to be instantiated from a user initiated event (such as responding to a Button.Click).

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

        N Offline
        N Offline
        NTheOne
        wrote on last edited by
        #3

        Hello, Thanks for the response. I am calling this method in the button click event and instantiated the SaveFileDialog in the same. Still got the error. Thanks...

        1 Reply Last reply
        0
        • N NTheOne

          Hello, While exporting the telerik chart to PNG image format, I received below mentioned error message. dialogs must be user-initiated. Perhaps the image is saved successfully. Can any one can help me why I got this type of error message? Here is my code: try { SaveFileDialog dialog = new SaveFileDialog(); dialog.DefaultExt = ".png"; dialog.Filter = "Portable Network Graphics (*.png)|*.png"; bool? showDialog = dialog.ShowDialog(); if (showDialog == true) { Stream fileStream = dialog.OpenFile(); MainChart.ExportToImage(fileStream, new Telerik.Windows.Media.Imaging.PngBitmapEncoder()); fileStream.Close(); } }

          A Offline
          A Offline
          Abhinav S
          wrote on last edited by
          #4

          This[^] might help/

          The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups