问题
I'm trying to display my Date in a RadGridView in ShortDate Format.
The code I used to generate the column is this :
<telerik:RadGridView x:Name="GenInq" Height="Auto" Width="Auto"
HorizontalAlignment="Left" Margin="0,-14,0,14" AutoGenerateColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewColumn Header="Date"
Binding.XmlNamespaceManager="{Binding Path=Date, StringFormat='{}{0:dd.MM.yyyy}'}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>`
This is my query i used to populate the DataGrid:
var query = from loan in Loans
select new {Date = loan.StatusCommittedDate}
DataGrid.ItemsSource = query.ToList();
The issue I'm having is that the Date Entries are appearing BLANK in the datagrid, it populates the grid with blank entries.
回答1:
I was able to replicate the issue and got the same results you did.
You need to change the column definition accordingly:
<telerik:GridViewDataColumn Header="Date"
DataMemberBinding="{Binding Path=Date, StringFormat='{}{0:dd.MM.yyyy}'}"/>
来源:https://stackoverflow.com/questions/21023836/telerik-radgridview-wont-display-dates