How to focus a DateTimePicker cell in Datagridview

Posted by Shree under VB.NET on 10/26/2010 | Points: 10 | Views : 3889 | Status : [Member] | Replies : 1

I have a datagridview in my form.
The first column is a combobox, the 2nd and 3rd are the datetimepicker columns created using sample code from microsoft.
When I add a new row I load the datetime columns with todays date.
When I change the first datetime column, I check whether the entered date is greater than the date in the next datetime column, If so, I need to focus back to the first datetime column.

I tried using the code from this forum, but it is not working for me.

I used the following code in the cellvaluechanged event.
dgv_Emp_Proj.CurrentCell = dgv_Emp_Proj.Item(1, 0)

Is it the problem with the property setting of the datagridview, or with the datetimepicker used in datagridview.
Or am I calling the code in the wrong event of the datagridview.

Trying to solve this for the past 2 days, but couldn't find a solution.

Any help in this regard?



Posted by: Naraayanan on: 1/6/2012 [Member] Starter | Points: 25

send your code.I will try

Lakshmi Naraayanan.S

Shree, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response