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. InvalidOperationException but why?

InvalidOperationException but why?

Scheduled Pinned Locked Moved C#
helpquestion
6 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.
  • E Offline
    E Offline
    error1408
    wrote on last edited by
    #1

    Hi guys, i have a form, which, on mouseclick, opens another form. Half of the time it's all well. But sometimes i get an InvalidOperationException with the message that this can't be done while resizing an automatically filled column. Now, on the second form there is a gridview, which is filled at the LOAD event. Creating Form 2: FrmPaths f = new FrmPaths(); f.Show(this); Load event: foreach (string s in PathManagment.Directories) { dataSet1.Tables["paths"].Rows.Add(new object[] { (s) }); } Could anybody please help me?

    G 1 Reply Last reply
    0
    • E error1408

      Hi guys, i have a form, which, on mouseclick, opens another form. Half of the time it's all well. But sometimes i get an InvalidOperationException with the message that this can't be done while resizing an automatically filled column. Now, on the second form there is a gridview, which is filled at the LOAD event. Creating Form 2: FrmPaths f = new FrmPaths(); f.Show(this); Load event: foreach (string s in PathManagment.Directories) { dataSet1.Tables["paths"].Rows.Add(new object[] { (s) }); } Could anybody please help me?

      G Offline
      G Offline
      Gamzun
      wrote on last edited by
      #2

      sounds strange ....... do you get this exception when you are debugging? if so, { then there's no problem :D } else { i don't know :D }

      E 1 Reply Last reply
      0
      • G Gamzun

        sounds strange ....... do you get this exception when you are debugging? if so, { then there's no problem :D } else { i don't know :D }

        E Offline
        E Offline
        error1408
        wrote on last edited by
        #3

        yes i got this exception when i was debugging. i even know where it came from. I had ColumnsHeaderHeigthSizeMode on Auto by mistake. I turned it off and now the problem is gone. I'd like to understand what the problem is, anyway. Nobody knows? Btw. why isn't there a problem if i was debugging? Thank you

        G 1 Reply Last reply
        0
        • E error1408

          yes i got this exception when i was debugging. i even know where it came from. I had ColumnsHeaderHeigthSizeMode on Auto by mistake. I turned it off and now the problem is gone. I'd like to understand what the problem is, anyway. Nobody knows? Btw. why isn't there a problem if i was debugging? Thank you

          G Offline
          G Offline
          Gamzun
          wrote on last edited by
          #4

          i don't know whats wrong with VS, i have noticed that when im in debugging mode sometimes i get exception but when im running the project normally that when not in debugging mode, it runs fine. and mostly the exeception is null reference exception.

          E 1 Reply Last reply
          0
          • G Gamzun

            i don't know whats wrong with VS, i have noticed that when im in debugging mode sometimes i get exception but when im running the project normally that when not in debugging mode, it runs fine. and mostly the exeception is null reference exception.

            E Offline
            E Offline
            error1408
            wrote on last edited by
            #5

            Ok thank you. That is good to know. I was really desperated.

            G 1 Reply Last reply
            0
            • E error1408

              Ok thank you. That is good to know. I was really desperated.

              G Offline
              G Offline
              Gamzun
              wrote on last edited by
              #6

              and yes i forgot to mention one thing, this type of error usually occurs when you are going to another class/form, like the way you were doing myform.show() and in your myform load event you had something n there you get some error :)

              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