Datagridview Focus to specific cell
-
Hi All, i am using DataGridView which contains 4 Columns in my c# 2005 application . When the user types some data in Column 1 and press enter the focus should go to Column 3 (or some other column) of the same row. in short how can i do programmatically set focus to specific cell(column) in a DataGridView. how can i achive this i serached info but not able to find any relavent data .
-
Hi All, i am using DataGridView which contains 4 Columns in my c# 2005 application . When the user types some data in Column 1 and press enter the focus should go to Column 3 (or some other column) of the same row. in short how can i do programmatically set focus to specific cell(column) in a DataGridView. how can i achive this i serached info but not able to find any relavent data .
-
Vijjuuuuuuuuu........... wrote:
in short how can i do programmatically set focus to specific cell(column) in a DataGridView
By setting the CurrentCell[^] property :)
I are Troll :suss:
-
Hi Eddy, Thanks for you reply . sorry to ask you again not clear with the example given , my requirment is ,focus should move to paticular cell (i will specify the row and column number) when the user is inputing the data .
Vijjuuuuuuuuu........... wrote:
my requirment is ,focus should move to paticular cell (i will specify the row and column number) when the user is inputing the data .
You can set the input-focus using the property "CurrentCell", like this;
dataGridView1.CurrentCell = dataGridView1[3, 4];
There's a "howto" article on this subject on MSDN[^] :)
I are Troll :suss:
-
Vijjuuuuuuuuu........... wrote:
my requirment is ,focus should move to paticular cell (i will specify the row and column number) when the user is inputing the data .
You can set the input-focus using the property "CurrentCell", like this;
dataGridView1.CurrentCell = dataGridView1[3, 4];
There's a "howto" article on this subject on MSDN[^] :)
I are Troll :suss:
Thank you very much for your prompt reply . Now i am facing new problem, celling focusing is not correct. its is focusing one row next to mentioned index . for example i have 4 columns for my grid. dataGridView1.CurrentCell = dataGridView1[0,2]; for the above code the focus to [1,2] any idea ? if not pls igorne my quesiton.