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. C#
  4. PropertyGrid TypeConverter

PropertyGrid TypeConverter

Scheduled Pinned Locked Moved C#
question
4 Posts 2 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.
  • D Offline
    D Offline
    Dylan van Heerden
    wrote on last edited by
    #1

    Hi Does anyone know what TypeConverter to use to open a OpenFileDialog from the propertygrid? Thank you, D

    J 1 Reply Last reply
    0
    • D Dylan van Heerden

      Hi Does anyone know what TypeConverter to use to open a OpenFileDialog from the propertygrid? Thank you, D

      J Offline
      J Offline
      joe carbone
      wrote on last edited by
      #2

      Hi D this is the code: [Browsable(true), Description("The filename for destination.")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string FileName { get {return _FileName;} set {_FileName = Path.GetFileName(value);} }

      D 1 Reply Last reply
      0
      • J joe carbone

        Hi D this is the code: [Browsable(true), Description("The filename for destination.")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string FileName { get {return _FileName;} set {_FileName = Path.GetFileName(value);} }

        D Offline
        D Offline
        Dylan van Heerden
        wrote on last edited by
        #3

        Hi Joe Thank you

        J 1 Reply Last reply
        0
        • D Dylan van Heerden

          Hi Joe Thank you

          J Offline
          J Offline
          joe carbone
          wrote on last edited by
          #4

          you can also create your own editor class. 1. create a new class and implement the openfiledialogeditor. override the initialize methode (this methode have 1 parameter e.g. the openfiledialog) now, in the methode you can set your own properties e.g title, filter .... 2. change the editorattribute in the property to your class [Browsable(true), Description("The filename for the destination.")] [EditorAttribute(typeof(MyNamespace.MyFileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string FileName { get {return _FileName;} set {_FileName = Path.GetFileName(value);} }

          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