Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Clicking on empty datagrid view.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2007
    Posts
    351

    Resolved [RESOLVED] [2005] Clicking on empty datagrid view.

    I have found that if you click on the blank space/background in a datagridview, the on click event is not fired if this datagridview has no cells. Do the same in a datagridview with a cell (still just clicking on the background, a cell is not selected) then the on click fires.

    Any one know of a why this might be, and/or a way round

    TIA

    Rico

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

    Re: [2005] Clicking on empty datagrid view.

    You appear to be mistaken. I just tested a DataGridView with no columns and no rows, with column but without rows, and with both columns and rows. In all three tests the Click and MouseClick events of the grid were both raised when I clicked the grey background. If you can provide steps to reproduce this issue from scratch then I'll take another look, but as it is I can only assume that you're doing something wrong.
    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

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2007
    Posts
    351

    Resolved Re: [2005] Clicking on empty datagrid view.

    Yes thanks, youre right as allways, turns out i wasn't adding the handlers when there wasn't any data in the datagridview.

    Rico

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