Telerik RadGridView将不显示日期 [英] Telerik RadGridView won't display Dates

查看:91
本文介绍了Telerik RadGridView将不显示日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以ShortDate格式在RadGridView中显示我的日期.

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>`  

这是我用来填充DataGrid的查询:

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.

推荐答案

我能够复制该问题并获得与您相同的结果.

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}'}"/>

这篇关于Telerik RadGridView将不显示日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆