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. Yet more data grid issues

Yet more data grid issues

Scheduled Pinned Locked Moved C#
csshelpdatabasequestion
4 Posts 4 Posters 1 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
    Ansch
    wrote on last edited by
    #1

    Hi, I've got a bit of a problem with using a data grid in a window application. The application crash if I try to double click on the resize row height cursor. ie. When my cursor is in between two row headers and the cursor becomes the resize cursor. Usually, when you double click in between columns, it automatically resize the columns. However, when I try to do the same with the rows, it crashes with this error message: "Fatal system error has occured. Index was out of range. Must be non-negitive and less than the size of the collection. Parameter name: startIndex, mscorlib" Is there anyway I can disable the feature of allowing the user to resize the rows?? Thanks in advance.

    R D 2 Replies Last reply
    0
    • A Ansch

      Hi, I've got a bit of a problem with using a data grid in a window application. The application crash if I try to double click on the resize row height cursor. ie. When my cursor is in between two row headers and the cursor becomes the resize cursor. Usually, when you double click in between columns, it automatically resize the columns. However, when I try to do the same with the rows, it crashes with this error message: "Fatal system error has occured. Index was out of range. Must be non-negitive and less than the size of the collection. Parameter name: startIndex, mscorlib" Is there anyway I can disable the feature of allowing the user to resize the rows?? Thanks in advance.

      R Offline
      R Offline
      Rocky Moore
      wrote on last edited by
      #2

      Have you tried overriding the OnResize? Rocky Moore

      L 1 Reply Last reply
      0
      • R Rocky Moore

        Have you tried overriding the OnResize? Rocky Moore

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        Hi OnResize would be related to the Datagrid control itself. Rather try overriding OnPreferredRowHeightChanged in the DataGridTableStyle class. Like: myGrid.Font = new System.Drawing.Font ("Microsoft Sans Serif", 15, System.Drawing.FontStyle.Regular); myGrid.PreferredRowHeight = myGrid.Font.Height; :)

        1 Reply Last reply
        0
        • A Ansch

          Hi, I've got a bit of a problem with using a data grid in a window application. The application crash if I try to double click on the resize row height cursor. ie. When my cursor is in between two row headers and the cursor becomes the resize cursor. Usually, when you double click in between columns, it automatically resize the columns. However, when I try to do the same with the rows, it crashes with this error message: "Fatal system error has occured. Index was out of range. Must be non-negitive and less than the size of the collection. Parameter name: startIndex, mscorlib" Is there anyway I can disable the feature of allowing the user to resize the rows?? Thanks in advance.

          D Offline
          D Offline
          Domenic Denicola
          wrote on last edited by
          #4

          Wow, happens on my DataGrids too! Must be a bug in the MS code... no? In any case, exceptions should not reach the user like that!

          -Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."

          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