data binding - C#: How to adjust the value the user entered in DataGridView? -


I have a database datagrid view. Data source is a type of data that contains two dateTime columns (< Code> StartTimeStamp and EndTimeStamp ). I read and write the data in the SQL Server 2005 database using the update command of the typed data set.

The user should enter a date in each of the two columns, which I would like to use for the Selenelization and Rowlification I apply for However, I also need to make sure that the following two rules apply:

  1. The time value for get started column should always be 00:00:00

As I do not want the user to enter 23:59:59 all the time, I somehow want to change the user's input 1 and 2. In my code

Where and how will I do this?

Edit

Sorry, if I was not clear, the user could enter any date part, though , Time portion for StartTimeStamp is fixed at midnight and for EndTimeStamp 23:59:59.

Example:

User enters the StartTimeStamp as of 01/01/01 01:00:00 PM. My application should change it 01/01/01 00:00:00.

As a user login, the end time stamp will be completed as of 01/01/2009 at 01:00. My application should change it 2009/01/31 23:59:59.

I just display the date as the date and add time behind the scenario.

This can happen when the user enters the data or evenly it can happen when you write the data to the database.

If you select Pre, then Data Grid Weave. Look at the SeledEdit event.

Check the noam response to the code to set the time for the time.


Comments