Hi All,
My Question is simple but please keep in mind I'm not binding it to any grid or any of ASP.NET control I have my own grid control and I want to keep it as a DateTime Column for sorting purpose.
I'm creating DataTable With Column Type DateTime.
DataTable data = new DataTable();
data.Columns.Add("Invoice Date", typeof(DateTime));
DataRow dr = data.NewRow();
dr[0] = DateTime.Now;
//Adding filled row to the DataTable object
dataTable.Rows.Add(dr);
When the Value is shown on ASP.NET page it is show something like this:
"2/28/2011 12:00:00 AM"
I have 2 columns like this, In 1 column I want to show just date and in other column i want to show date as "Dec 2011", these formats can be achieved if i use DataColumn with type string but in that case sorting is not working properly.
Please help.
Thanks.