Search

DataGridView Row Select with EditMode=EditOnEnter by michaelAngeloEgypt

Closed
as By Design Help for as By Design

8
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 98504
Opened: 4/12/2006 11:52:56 PM
Access Restriction: Public
2
Workaround(s)
5
User(s) can reproduce this bug
I have found that if I set a DataGridView's EditMode property to EditOnEnter then the user cannot select an entire row by clicking on the row header. This prevents the user from being able to delete a row.
Details (expand)
Product Language
English
Version
Visual Studio 2005
Category
Base Class Libraries and APIs
Subcategory
 
Operating System
Windows XP Professional
Steps to Reproduce
Assign the EditMode property of the DataGridView to EditOnEnter, then run the application and try to delete a row from the grid by clicking on the row header
Actual Results
the contents of the first cell of the row gets highlighted, so if you press Delete, you delete the contents of the first cell only and not the entire row
Expected Results
since i clicked on the rowheader, i was expecting the entire row to be selected, and not a specific cell inside it. I also tried all variations of SelectionMode but that didn't solve.
(i definitely have to have EditMode be EditOnEnter)
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 4/13/2006 at 1:02 AM
Thank you for your feedback. We are investigating this issue.

Thank you, Visual Studio Product Team.
Posted by Microsoft on 6/22/2006 at 4:44 PM
Thanks for your feedback. This behavior is by design. The editing control has focus and gets the Del keystroke, and handles it. You can handle the Del key by deriving from the DataGridView control and overriding the ProcessDataGridViewKey method:

    public class MyDataGridView : DataGridView
    {

        protected override bool ProcessDataGridViewKey(KeyEventArgs e)
        {
            // intercept the Del key here
            return base.ProcessDataGridViewKey(e);
        }
    }

Thank you.
Posted by tg440766 on 7/16/2009 at 6:54 AM
This is bad design then. You click the row header and instead of selecting or setting focus to the entire row it selects a particular cell?!? Who came up with this idea? By Design? More like someone to lazy to fix a bug.
Posted by Juxta Roma on 9/30/2009 at 6:26 PM
I completely agree. This is bad design.
If have a whole row selected. Then delete should have different behaviour.
Dear Microsoft.
Please fix this? The grid would be so much cooler if you do.