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. Other Discussions
  3. The Weird and The Wonderful
  4. I feel dirty [modified]

I feel dirty [modified]

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpcssvisual-studiowinformscollaboration
2 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
    Dan Neely
    wrote on last edited by
    #1

    EDIT: GAH! At some point between when I snagged the idea from msdn forums, tested, committed it, and posted this; and when I went back to work it decided to stop working. :doh: :doh: :doh: :doh: I Graus VS! EDIT2: No sooner do I make my first edit but it starts working again. :(( Just committed this kludge to svn because the winforms datagridview designer was written by an idiot.

    /// <summary>
    /// Works around a bug in the form designer. Doesn't do any painting logic.
    /// </summary>
    /// <param name="sender">Unused.</param>
    /// <param name="e">Unused.</param>
    /// <remarks>
    /// Is putting this line here to stop columns from auto-generating in the designer a WTF?
    /// Yes, but so is this being the only way to do it if you want anything other than 100% default
    /// datbound columns without having to do all the grid layout without the aid of the designer.
    /// The AutoGenerateColumns property can't be set in the designer and the constructor is already too late.
    /// </remarks>
    private void DataGridView1Paint(object sender, PaintEventArgs e)
    {
    dataGridView1.AutoGenerateColumns = false;
    }

    3x12=36 2x12=24 1x12=12 0x12=18

    B 1 Reply Last reply
    0
    • D Dan Neely

      EDIT: GAH! At some point between when I snagged the idea from msdn forums, tested, committed it, and posted this; and when I went back to work it decided to stop working. :doh: :doh: :doh: :doh: I Graus VS! EDIT2: No sooner do I make my first edit but it starts working again. :(( Just committed this kludge to svn because the winforms datagridview designer was written by an idiot.

      /// <summary>
      /// Works around a bug in the form designer. Doesn't do any painting logic.
      /// </summary>
      /// <param name="sender">Unused.</param>
      /// <param name="e">Unused.</param>
      /// <remarks>
      /// Is putting this line here to stop columns from auto-generating in the designer a WTF?
      /// Yes, but so is this being the only way to do it if you want anything other than 100% default
      /// datbound columns without having to do all the grid layout without the aid of the designer.
      /// The AutoGenerateColumns property can't be set in the designer and the constructor is already too late.
      /// </remarks>
      private void DataGridView1Paint(object sender, PaintEventArgs e)
      {
      dataGridView1.AutoGenerateColumns = false;
      }

      3x12=36 2x12=24 1x12=12 0x12=18

      B Offline
      B Offline
      BobJanova
      wrote on last edited by
      #2

      We had this very issue the other day on my team. And several other issues on my previous project related to data binding. Yes, the DGV seems to have been written by an idiot.

      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