Results 1 to 6 of 6

Thread: Issue with Datagridview in a Groupbox

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Issue with Datagridview in a Groupbox

    I'm having a problem with a DGV in a Groupbox. When I populate the rows, only the highlighted row shows the cell contents. The rest are blank. When I click on each row the cell contents shows for that row & the previously highlighted row goes blank. So all the values are there, but only the highlighted row shows its contents & all the other rows show empty cells. If I move the DGV out of the Groupbox then all the rows cell contents are visible. Has anyone seen this before? Is there a workaround?

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,517

    Re: Issue with Datagridview in a Groupbox

    Need more information.

    Is this a .Net Framework or Core?
    Need to see the relevant code.

    I was curious and tested this problem. Framework project, I added a groupbox to a form, added a dgv to the groupbox, in FormLoad I assigned a datatable as the dgv datasource. It worked fine.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Issue with Datagridview in a Groupbox

    Interesting that it worked for you. It's a .Net Framework project. I'm populating the DGV manually, 1 row at a time. Also the Groupbox is on a TabPage of a TabControl. Not sure if that makes a difference.

  4. #4
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,517

    Re: Issue with Datagridview in a Groupbox

    Works in a tabcontrol just fine. Have you tested it, add a form, drop a tabcontrol, groupbox, dgv, and populate in formload event.

    Still no code.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Issue with Datagridview in a Groupbox

    I didn't create a new project to test it. I just discovered it didn't work as expected in my current project.
    What code do you want to see? It's just using the DataGridView.Rows.Add() method in a loop. My code iterates through the nodes of a JSON string & adds the info to the DGV.

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

    Re: Issue with Datagridview in a Groupbox

    Show us all the code we need to replicate your scenario. This is not normal behaviour so it's something specific causing it, so we need all the specifics. Even then, it may still just be something dodgy on your system. You really should have tested in a new project even before posting here though. If it's something specific to that project then you will be able to work that out for yourself and we won't be able to help you fix an issue that we can't replicate. Sometimes a project gets corrupted and it's not easy to work out how or how to fix it and the best solution is to copy all the parts over to a new project, so that may be what you need to do. There's steps you should be taking yourself before that though. Only if you can replicate the issue should we bother even trying.
    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