Windows Develop Bookmark and Share   
 index > Windows Forms General > focus in datagridview in C# 2.0
 

focus in datagridview in C# 2.0

Hi ,

i have 3 columns in datagridview , in which second column is binded with datetime control.
when the focus is on the second column ,i m trying using arrow keys to set the focus to another cell.

my problem is focus is not changing from second column

i tried with " protected override bool ProcessCmdKey(ref Message msg, Keys keyData)" this event but not working.

can anyone tell whats happening....
  • Moved byHarry ZhuMSFTFriday, September 25, 2009 6:43 AM (From:Visual C# General)
  •  
stonedeepak  Wednesday, September 23, 2009 9:33 AM

Hi,

If you don’t want the user set the focus on second column, there are two events need to be override: SetCurrentCellAddressCore and SetSelectedCellCore.

Please refer to this FAQ, it shows the full example about restricting users from setting focus.

1.How do I restrict users from setting focus to a specific cell?

http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/a44622c0-74e1-463b-97b9-27b87513747e#Faq1

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Tuesday, September 29, 2009 9:18 AM

Hi,

If you don’t want the user set the focus on second column, there are two events need to be override: SetCurrentCellAddressCore and SetSelectedCellCore.

Please refer to this FAQ, it shows the full example about restricting users from setting focus.

1.How do I restrict users from setting focus to a specific cell?

http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/a44622c0-74e1-463b-97b9-27b87513747e#Faq1

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Tuesday, September 29, 2009 9:18 AM

You can use google to search for other answers

Custom Search

More Threads

• adding a NumericUpDown component to the drop down menu
• Strange memory leak with embedded windows media player in IPC
• RadionButton problem in different groupbox!
• How to implement a Rocker Switch â€?3 way button?
• How to change the Font styles of the MessageBox??
• How to play the "SWF" and "WAV" files in winform?
• Treeview too slow...
• Spinning progress control like in SQL Server 2005
• problem binding user control in the panel control
• Shift drawn line on control resize...?