Hi, I'm sorry for my english;
I use a string(AAAAMMDD :20121107) to save a Date (in my DataBase), So I do not know what type use to display my date.
I tried to use textColumn and in the RowFormatting event I transform (using my own object) my string like i want (DD/MM/AAAA :7/11/2012), but I need sort the column and I use the CustomSorting event:
And It does not work, also no sort by other columns.
The other method of load is transform my string in a DateTime for use DateTime Column, but I don't know where i have to make the transform or if I can tell what will be the column data format to receive would be perfect.
I tried to convert the string to DateTime in RowFormatting event, but does not show well the data and does not order correctly.
What would be the correct way to load the date data type using me? thanks
I use a string(AAAAMMDD :20121107) to save a Date (in my DataBase), So I do not know what type use to display my date.
I tried to use textColumn and in the RowFormatting event I transform (using my own object) my string like i want (DD/MM/AAAA :7/11/2012), but I need sort the column and I use the CustomSorting event:
private
void
radGridView1_CustomSorting(
object
sender, GridViewCustomSortingEventArgs e)
{
MyObjDate row1Freight = new MyObjDate(e.Row1.Cells[
"colDate"
].Value.ToString());
MyObjDate row2Freight =new
MyObjDate(e.Row2.Cells[
"colDate"
].Value.ToString())
;
if
(row1Freight > row2Freight)
{
e.SortResult = 1;
}
else
if
(row1Freight < row2Freight)
{
e.SortResult = -1;
}
else
{
e.SortResult = 0;
}
}
And It does not work, also no sort by other columns.
The other method of load is transform my string in a DateTime for use DateTime Column, but I don't know where i have to make the transform or if I can tell what will be the column data format to receive would be perfect.
I tried to convert the string to DateTime in RowFormatting event, but does not show well the data and does not order correctly.
What would be the correct way to load the date data type using me? thanks