Results 1 to 4 of 4

Thread: [2008] defaultvaluesneeded datagridview problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2007
    Posts
    103

    [2008] defaultvaluesneeded datagridview problem

    I am using the defaultvaluesneeded event to set the default values of a new row, however these values are not being set until I actually click the empty new row. I want the default values to be filled out before the user clicks the new row, is this possible?

  2. #2
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: [2008] defaultvaluesneeded datagridview problem

    If there is not new row created than where you want to set the default values?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2007
    Posts
    103

    Re: [2008] defaultvaluesneeded datagridview problem

    When datagridview is in edit mode at the bottom there is normally an empty row. Since I have image columns this empty row displays the image not found icon and I would prefer it displays a blank cell (new bitmap(1,1)), simply because it looks nicer, may seem trivial but I would appreciate help.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] defaultvaluesneeded datagridview problem

    That last row isn't supposed to contain data. You'll notice that as soon as you start entering data another empty row is created. I don't know but I would guess that if you tried to display an image in that cell it would constitute entering data and trigger a new row to be created.

    This is a bit of speculation as I've never done this myself but I would think that you'd have to handle the CellPainting event or the like and, if it's an image cell in the shared row, then customise its appearance so it doesn't display that icon.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width