通过 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; }
}
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; }
}
相关文章推荐
- 通过 IDictionary对Silverlight DataGrid 进行动态数据绑定
- Silverlight 通过索引器绑定动态数据
- Silverlight 4 DataGrid动态生成列及绑定数据
- Silverlight 4 DataGrid动态生成列及绑定数据
- easy ui datagrid 动态绑定数据并绑定链接,进行操作
- Silverlight 通过索引器绑定动态数据
- 稳扎稳打Silverlight(17) - 2.0数据之详解DataGrid, 绑定数据到ListBox
- 插件中对动态表单数据模型进行赋值实现动态表单数据绑定
- 根据已经加载好的datagrid数据,通过条件查询进行重新根据查询的条件进行加载:(无需通过后台再次查询)
- asp.net and datagrid 动态绑定数据列与存取特定列的值
- 将使用DataGrid进行数据绑定,使用Javascript控制当选中其中的checkbox时,该行颜色改变
- silverLight--绑定数据dataGrid
- JQuery中使用UI-Datagrid进行数据绑定
- Dataset数据通过Web服务进行输出数据绑定
- 扩展jquery easyui datagrid 之动态绑定列和数据
- 稳扎稳打Silverlight(17) - 2.0数据之详解DataGrid, 绑定数据到ListBox
- 对BriskDataGrid进行数据绑定
- (转)扩展jquery easyui datagrid 之动态绑定列和数据
- 插件中对动态表单数据模型进行赋值实现动态表单数据绑定
- WPF备忘录(3)如何从 Datagrid 中获得单元格的内容与 使用值转换器进行绑定数据的转换IValueConverter