c# - DateFormat in radGridViewDataColumn WPF -
i'm working on wpf mvvm
application telerik
controls. need format 1 of column date(mm/dd/yyyy
). when select date calendar works fine , after switching next column value showed mm/dd/yyyy 12:00:00
. dont need time displyed along.
//code:
<telerik:gridviewdatacolumn header="apprvddate" datamemberbinding="{binding approveddate, mode=twoway, updatesourcetrigger=propertychanged}" dataformatstring="{}{0: mm/dd/yyyy}"> <telerik:gridviewdatacolumn.celledittemplate> <datatemplate> <telerik:raddatepicker name="clrdatepicker" selecteddate="{binding approveddate, mode=twoway}" allowdrop="true"> </telerik:raddatepicker> </datatemplate> </telerik:gridviewdatacolumn.celledittemplate> </telerik:gridviewdatacolumn>
where approveddate
string
object in collection.
the dataformatstring
doesn't work. tried changing many formats.
also tried as,
dataformatstring="{0: mm/dd/yyyy}"
which throws compilation error.
where i'm wrong?
you need expose approveddate
datetime
property instead of string
- dataformatstring
work correctly on type.
either or wherever converting string
, use format string require instead of simple .tostring()
call calling .tostring("mm/dd/yyyy")
.
Comments
Post a Comment