Hi There,
I am having difficulty understanding what is going wrong with my code.
I have a gridview wtih a datasource set to an entity framework object. In the gridview is a datetimepicker column that I want to show the date in the format "dd/MM/yyyy" the format of the information stored in my entity framework is in the format "dd/MM/yyyy" Upon loading the datagridview I populate the gridview with the information from my EF object. This works a deam and is as expected.
However the problems begin when I add a new row to the datagrid, no matter what I try when adding a new row the datetimepicker always sets the column to have a value including the time. I have set the format string correctly to "{0: dd/MM/yyyy}". If I stop the datasource binding to my EF object the date is added correctly to the new row. It seems that the problem only occurs If I use the datasource.
It would appear that this is a problem with the .fieldname I am using, if I remove this I have no problems.
Anyone offer any advice on what is going wrong here?
Many Thanks
I am having difficulty understanding what is going wrong with my code.
I have a gridview wtih a datasource set to an entity framework object. In the gridview is a datetimepicker column that I want to show the date in the format "dd/MM/yyyy" the format of the information stored in my entity framework is in the format "dd/MM/yyyy" Upon loading the datagridview I populate the gridview with the information from my EF object. This works a deam and is as expected.
However the problems begin when I add a new row to the datagrid, no matter what I try when adding a new row the datetimepicker always sets the column to have a value including the time. I have set the format string correctly to "{0: dd/MM/yyyy}". If I stop the datasource binding to my EF object the date is added correctly to the new row. It seems that the problem only occurs If I use the datasource.
It would appear that this is a problem with the .fieldname I am using, if I remove this I have no problems.
Anyone offer any advice on what is going wrong here?
Many Thanks