您的位置:首页 > 其它

通过 IDictionary对Silverlight DataGrid 进行动态数据绑定

2009-05-27 11:04 441 查看
要对DataGrid进行数据绑定,通常我们需要定义具体类,而后建立类的范式集合。如下所示:

public class DateConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
DateTime date = (DateTime)value;
return date.ToShortDateString();
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class MyTime
{
public DateTime Time1 { get; set; }
public DateTime Time2 { get; set; }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: