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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Ques. in VC#.Net

Ques. in VC#.Net

Scheduled Pinned Locked Moved C#
questioncsharpdatabase
5 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.
  • A Offline
    A Offline
    Andy Rama
    wrote on last edited by
    #1

    Hi to all, How can I add code to User Control Unload Event? ( Code at time of Form Close in UserControl Code). What is the use of RowHeader in DataGridView? Can I show index automatically to each row? How Can I validate a path of a file? Thanks & Best Regrads, Aniket Salunkhe

    D 1 Reply Last reply
    0
    • A Andy Rama

      Hi to all, How can I add code to User Control Unload Event? ( Code at time of Form Close in UserControl Code). What is the use of RowHeader in DataGridView? Can I show index automatically to each row? How Can I validate a path of a file? Thanks & Best Regrads, Aniket Salunkhe

      D Offline
      D Offline
      Daniel Persson
      wrote on last edited by
      #2

      what do you mean by validating the path of a file? Check if it contains "valid" characters? use regexp. If you wan't to check if the folder specified exist use: System.IO.Directory.Exists(folder) If you wan't to check if the file exists use: System.IO.File.Exists(file) You will have to explain a little bit more for me what you mean by your first question. Every form has a FormClosing event, maybe you could use it to trigger other events/methods to do your work...

      A 1 Reply Last reply
      0
      • D Daniel Persson

        what do you mean by validating the path of a file? Check if it contains "valid" characters? use regexp. If you wan't to check if the folder specified exist use: System.IO.Directory.Exists(folder) If you wan't to check if the file exists use: System.IO.File.Exists(file) You will have to explain a little bit more for me what you mean by your first question. Every form has a FormClosing event, maybe you could use it to trigger other events/methods to do your work...

        A Offline
        A Offline
        Andy Rama
        wrote on last edited by
        #3

        Hi, I have designed an User Control having 'DataGridView' in it, which uses XML-File to show data in grid. But I want to Write the XML-File (changes made in grid ) when application closes. How to do that? What event should I use for that in the 'User Control '? Is there any Unload event for User Control? Thanks & Best Regards, Aniket Salunkhe

        D 1 Reply Last reply
        0
        • A Andy Rama

          Hi, I have designed an User Control having 'DataGridView' in it, which uses XML-File to show data in grid. But I want to Write the XML-File (changes made in grid ) when application closes. How to do that? What event should I use for that in the 'User Control '? Is there any Unload event for User Control? Thanks & Best Regards, Aniket Salunkhe

          D Offline
          D Offline
          Daniel Persson
          wrote on last edited by
          #4

          ok, so what if you make a function in your control, let's call it SaveStructure() In your mainform/mainwindows/mainapplication you add this code to FormClosing event: MyFancyInstanceOfMyObject.SaveStructure(); done ... To be honest I don't know(I don't think there is an UnLoad event for user-controls by standard). But this should work anyway...

          A 1 Reply Last reply
          0
          • D Daniel Persson

            ok, so what if you make a function in your control, let's call it SaveStructure() In your mainform/mainwindows/mainapplication you add this code to FormClosing event: MyFancyInstanceOfMyObject.SaveStructure(); done ... To be honest I don't know(I don't think there is an UnLoad event for user-controls by standard). But this should work anyway...

            A Offline
            A Offline
            Andy Rama
            wrote on last edited by
            #5

            Hi, Thanks. Same think I have done. I thought that I am missing some thing. But if you have another solution for my User Control just tell me. Also I have another query... What is the use of RowHeader in DataGridView? Can I add a column (1st column) such that it will show index (automatically increasing/decreasing) of each row? i.e. same as Numbering done in Word Document Thanks & Best Regards, Aniket Salunkhe

            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