Hi cindy,
Thank you for posting.
Regarding the data formatting in DataGrid column for DateTime data field, I
think it is likely the data binding expression in the first code snippet
you pasted hasn't been evaluated correctly by the runtime. I think you can
try call the GetType method on the returned object and print it out to see
whether it is of the correct type like DataBinder.Eval(Container.DataItem,
"reviseddate").GetType().ToString(). Also, the casting error may also
occur on other step in the databinding. You can define a helper function in
the page's codebehind class to do the formatting. e.g:
<%# MyConvertFunc( DataBinder.Eval(......)) %>
in code behind, define:
protected string MyConvertFunc(object obj)
{
.................
}
Please feel free to let me know if there is anything else I missed.
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)