Jump to content

Unable to focus perticular cell in the datagridview

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Guest_salahuddin.syed_*

Guest_salahuddin.syed_*
  • Guests
Hi,

I am using datagridview and am unable to focus perticular cell in the
datagridview. like if i press tab/enter from first cell it should go to third cell.

Thank you, in advance.

#2
cdg10620

cdg10620

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 389 posts
Are you doing this on a web page or in a forms application? If it is a web page it seems that you could handle the tab or enter press with javascript and set focus on the appropriate cell. If it is in a forms application then the gridview should be in an update panel and you can get the specific keypress number for each and set the appropriate cell. If is is on the back end in C# you would do something like this:

this.myDatagrid.Items[rowIndex].Cells[cellIndex]

That will select a specific cell in a specific row. The syntax is not exact but it should be similar. Let me know if you have any other questions or issues.
-CDG10620
Software Developer