Click here to Skip to main content
15,908,901 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to keep datagridview in editmode on pressing of arrow keys Pin
Sascha Lefèvre22-May-15 1:00
professionalSascha Lefèvre22-May-15 1:00 
If you haven't already, create a custom class deriving from DataGridView and override the method ProcessCmdKey. In that method you can check if the key that is pressed is one of the arrow keys and inhibit its normal effect by not calling the base implementation:
C#
public class MyDataGridView : DataGridView
{
    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    {
        if (keyData == Keys.Left ||
            keyData == Keys.Right ||
            keyData == Keys.Up ||
            keyData == Keys.Down)
        {
            return true;
        }

        return base.ProcessCmdKey(ref msg, keyData);
    }
}


If you need help on how to use such a subclassed Control in your Form/Project, please see here:
Override datagridview_keypress method[^]
(It addresses overriding the OnKeyPress-method but apart from that it's all the same.)
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

GeneralRe: how to keep datagridview in editmode on pressing of arrow keys Pin
Muhammad Waqas Aziz26-May-15 23:31
Muhammad Waqas Aziz26-May-15 23:31 
AnswerRe: how to keep datagridview in editmode on pressing of arrow keys Pin
Simon_Whale22-May-15 1:23
Simon_Whale22-May-15 1:23 
Questionhelp in datagride view CellLeave Pin
aahamdan21-May-15 21:00
aahamdan21-May-15 21:00 
AnswerRe: help in datagride view CellLeave Pin
Sascha Lefèvre22-May-15 0:01
professionalSascha Lefèvre22-May-15 0:01 
AnswerRe: help in datagride view CellLeave Pin
Muhammad Waqas Aziz22-May-15 0:35
Muhammad Waqas Aziz22-May-15 0:35 
GeneralRe: help in datagride view CellLeave Pin
aahamdan26-May-15 13:02
aahamdan26-May-15 13:02 
QuestionControls Pin
Member 1136270921-May-15 20:22
Member 1136270921-May-15 20:22 
AnswerRe: Controls Pin
OriginalGriff21-May-15 22:25
mveOriginalGriff21-May-15 22:25 
AnswerRe: Controls Pin
Eddy Vluggen22-May-15 2:17
professionalEddy Vluggen22-May-15 2:17 
QuestionDayPilot Calendar cannot Update clientState If i Navigate... Pin
Victor Ebe21-May-15 6:11
Victor Ebe21-May-15 6:11 
AnswerRe: DayPilot Calendar cannot Update clientState If i Navigate... Pin
Ravi Bhavnani21-May-15 8:07
professionalRavi Bhavnani21-May-15 8:07 
QuestionHow to use password protected sqlite database? Pin
DPaul199421-May-15 5:07
DPaul199421-May-15 5:07 
QuestionRe: How to use password protected sqlite database? Pin
Richard MacCutchan21-May-15 5:38
mveRichard MacCutchan21-May-15 5:38 
AnswerRe: How to use password protected sqlite database? Pin
DPaul199421-May-15 6:12
DPaul199421-May-15 6:12 
GeneralRe: How to use password protected sqlite database? Pin
Richard MacCutchan21-May-15 7:48
mveRichard MacCutchan21-May-15 7:48 
GeneralRe: How to use password protected sqlite database? Pin
Eddy Vluggen21-May-15 8:25
professionalEddy Vluggen21-May-15 8:25 
AnswerRe: How to use password protected sqlite database? Pin
OriginalGriff21-May-15 6:05
mveOriginalGriff21-May-15 6:05 
QuestionProgram for an older version than the one in GAC Pin
Member 1124071321-May-15 4:22
Member 1124071321-May-15 4:22 
SuggestionRe: Program for an older version than the one in GAC Pin
Abhipal Singh21-May-15 8:11
professionalAbhipal Singh21-May-15 8:11 
QuestionWant to ask about Memory (private working set) Windows Services Pin
Mercurius8421-May-15 1:54
Mercurius8421-May-15 1:54 
AnswerRe: Want to ask about Memory (private working set) Windows Services Pin
OriginalGriff21-May-15 2:24
mveOriginalGriff21-May-15 2:24 
AnswerRe: Want to ask about Memory (private working set) Windows Services Pin
Dave Kreskowiak21-May-15 2:28
mveDave Kreskowiak21-May-15 2:28 
QuestionHelp this code shows to me what to do?? Pin
abdo.kouta21-May-15 1:45
abdo.kouta21-May-15 1:45 
AnswerRe: Help this code shows to me what to do?? Pin
Pete O'Hanlon21-May-15 2:13
mvePete O'Hanlon21-May-15 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.