> 1. I want to shift the focus to the next cell or a
> particular cell in datagridview while i press the Enter key
When you are navigating in the control, intercept the KeyPress event. If the key is Return, select the next cell that you want and set e.Handled = True to tell the control not to process the Return key.
Unfortunately when you are editing a value, the DataGridView control doesn't have focus, the editing control (normally a DataGridViewTextBoxEditingControl--now that's a mouthful!) does so you cannot catch the Return key as easily. When you press Return, the editing control hides and focus moves to the next cell down.
To handle this, catch the EditingControlShowing event that occurs when the editing control is displayed and save the current row number. In the SelectionChanged event handler, restore the row if we were just editing. Here's an example:
http://www.vb-helper.com/howto_2005_...enter_key.html
> 2. Is there any way to color the entire row
> (which the currenct cell is on editing)
In the SelectionChanged event handler, set the current row's DefaultCellStyle property. If you want it to look just like the selected cell, set BackColor to SystemColors.Highlight and set ForeColor to SystemColors.HighlightText (although then the user won't be able to tell which column is selected). Here's an example:
http://www.vb-helper.com/howto_2005_...color_row.html
> 3. How can i remove a particular row
Try using the Rows collection's Remove or RemoveAt method. See:
http://www.vb-helper.com/howto_2005_...elete_row.html
> how can i set the color of the editing cell.
In the EditingControlShowing event handler, set e.Control.ForeColor and e.Control.BackColor. See:
http://www.vb-helper.com/howto_2005_...ing_color.html
> how can i trace the text (which was typed by the user)
> - like in textbox's textchange. all i need is i want to
> know the each character - the user typed.
In the EditingControlShowing event handler, add an event handler to the editing control. See this example:
http://www.vb-helper.com/howto_2005_...t_changed.html
> when i was in edit mode, while i press the ENTER the focus
> shift to the below cell, i want to shift it to the adjacent cell, any tips?
See the earlier example:
http://www.vb-helper.com/howto_2005_...enter_key.html
Rod
RodStephens@vb-helper.com
Check out my latest book:
"Expert One-on-One Visual Basic 2005 Design and Development"
http://www.vb-helper.com/one_on_one.htm
Sign up for the free
VB Helper Newsletters at
http://www.vb-helper.com/newsletter.html