Hi,
We are using RadGrid to render our data in tabular format. There is one DateTime column that is going to show the data in "MMMM dd, yyyy" format (i.e. December 15, 2012). We are trying using GridDateTimeColumn and GridTemplateColumn for the same. But we are not able to fulfill our requirements.
Requirements are :
1. Datetime column should not show "12:00 AM" if it does not have any time information. (should show date part only) (i.e. December 15, 2012)
2. Null or 1/1/1900 date value should be shown as Blank. (i.e. EMPTY)
3. If time part is available, column/cell should have time part visible next to date (i.e. December 15, 2012 05:00 PM)
4. there should be datepicker for filtering on column.
All these should work together.
We have tried following approaches but we are not able to do conditional formatting. We are able to go either way. Can anyone please help on this?
Your quick reply should be really helpful.
Regards,
Maulik
We are using RadGrid to render our data in tabular format. There is one DateTime column that is going to show the data in "MMMM dd, yyyy" format (i.e. December 15, 2012). We are trying using GridDateTimeColumn and GridTemplateColumn for the same. But we are not able to fulfill our requirements.
Requirements are :
1. Datetime column should not show "12:00 AM" if it does not have any time information. (should show date part only) (i.e. December 15, 2012)
2. Null or 1/1/1900 date value should be shown as Blank. (i.e. EMPTY)
3. If time part is available, column/cell should have time part visible next to date (i.e. December 15, 2012 05:00 PM)
4. there should be datepicker for filtering on column.
All these should work together.
We have tried following approaches but we are not able to do conditional formatting. We are able to go either way. Can anyone please help on this?
Your quick reply should be really helpful.
<
rad:GridDateTimeColumn
UniqueName
=
"GridDateTimeColumnEndDate"
AllowSorting
=
"true"
Visible
=
"True"
HeaderText
=
"Ends"
DataField
=
"EndDate"
SortExpression
=
"EndDate"
ReadOnly
=
"true"
AutoPostBackOnFilter
=
"true"
CurrentFilterFunction
=
"EqualTo"
ShowFilterIcon
=
"false"
DataType
=
"System.DateTime"
DataFormatString
=
"{0:MMMM dd, yyyy}"
EnableTimeIndependentFiltering
=
"false"
>
<
ItemStyle
Width
=
"260px"
/>
</
rad:GridDateTimeColumn
>
<
rad:GridTemplateColumn
UniqueName
=
"EndDate"
HeaderText
=
"EndDate"
DataField
=
"EndDate"
SortExpression
=
"EndDate"
AutoPostBackOnFilter
=
"true"
CurrentFilterFunction
=
"Contains"
ShowFilterIcon
=
"false"
DataType
=
"System.DateTime"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblend"
runat
=
"server"
Text='<%# fixDate(DataBinder.Eval(Container.DataItem,"EndDate")) %>'></
asp:Label
>
</
ItemTemplate
>
<
FilterTemplate
>
<
rad:RadDatePicker
ID
=
"rp"
runat
=
"server"
Width
=
"100px"
SelectedDate='<%# SetEndDate(Container) %>' ClientEvents-OnDateSelected="DateSelected" >
<
DateInput
runat
=
"server"
DateFormat
=
"MMMM dd, yyyy"
></
DateInput
>
</
rad:RadDatePicker
>
</
FilterTemplate
>
<
ItemStyle
Font-Size
=
"10pt"
Width
=
"150px"
/>
</
rad:GridTemplateColumn
>
Regards,
Maulik