u can make a component of custom date format by inheriting
System.windows.Forms.DateTimePicker.
Inside InitalizeComponent() make a code like ds.
Format = DateTimePickerFormat.Custom
CustomFormat="dd/mm/yy"
bulid it and refernce this to ur application.
u can directly do ds this code in a form also.
[quoted text, click to view] stany wrote:
> I needed to get a string formatted in to datetime and do a sort on the field. The problem however is that I need the datetime format to be dd MMM yy and also allow a sort on the column. converting the string to date time will do away the formatting; and am getting a longdate format instead. Sticking with the string ("dd MMM yy") would not help me with sorting.
>
> See the code below.
>
> <asp:TemplateColumn SortExpression="TRANSACTIONDATE" HeaderText="Date">
> <ItemTemplate>
> <%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem,"TRANSACTIONDATE" )).ToString("dd MMM yy") %>
> </ItemTemplate>
> </asp:TemplateColumn>
>
> Any help on this would be appreciated.
>
>
> ---
> Posted using Wimdows.net Newsgroups -
http://www.wimdows.net/newsgroups/