|
Subject:
|
Date/Time presentation in a GridView
|
|
Posted By:
|
snufse
|
Post Date:
|
4/16/2008 1:03:08 PM
|
I am using a stored procedure in my web application and following definition:
CREATE TABLE #JobListTable ( job_date datetime, job_number char(15), cost_code char(15), qty_delivered decimal(8,2),
When I display the data in a web page and a GridView the date comes up as:
4/15/2008 12:00:00 AM 4/16/2008 12:00:00 AM
When I display the data using Windows from and DataGridView the date comes up as:
4/15/2008 4/16/2008
How can I manipulate the the result only to show date in my web page (without changing anything in my stored procedure)?
|
|
Reply By:
|
weicco
|
Reply Date:
|
4/18/2008 4:58:18 AM
|
Are you using AutoGenerateColumn? If yes, then skip the following.
Open the form in designer view. Select grid and click F4 (properties). Click that ... button besides Columns (collection) and Fields-dialog pops up.
Select appropriate field from the Selected fields - list. At the properties list at the right switch HtmlEncode to False. Then insert your format string to DataFormatString field. I think simple 'd' (without apostrophes) will do fine.
|
|
Reply By:
|
snufse
|
Reply Date:
|
4/18/2008 8:24:09 AM
|
Hello weicco:
That was cool and it worked perfectly. I was able to do some other nice adjustments. Thank you, that saved me a lot of work and saved my day.....
|