摘要: 使用 XAML 元素填充 ListBox<ListBox Width="150" Margin="0,5,0,10"> <TextBlock Text="TextBlock" /> <TextBox Text="TextBox" /> <Button Content="Button" /> <Rectangle Fill="LightBlue" Height="20" Width="100&q 阅读全文
posted @ 2011-03-14 23:20 南宫元耘 阅读(1461) 评论(0) 推荐(0) 编辑
摘要: 通过对数据进行分组、排序和筛选,以不同方式查看 DataGrid 中的数据常常很有用。若要对 DataGrid 中的数据进行分组、排序和筛选,您要将其绑定到支持这些功能的集合视图。然后,您可以在集合视图中操作这些数据,而不会影响基础数据。该集合视图中的更改将反映在 DataGrid 用户界面 (UI) 中。PagedCollectionView 类为实现 IEnumerable 接口的数据源提供分组、排序和分页功能。将 DataGrid 绑定到 PagedCollectionView创建实现 IEnumerable 接口的数据集合。说明:该集合中的对象必须实现 INotifyPropertyC 阅读全文
posted @ 2011-03-14 21:02 南宫元耘 阅读(2781) 评论(0) 推荐(0) 编辑
摘要: 1. 修改生成的列 在 AutoGeneratingColumn 事件处理程序中,通过引用 DataGridAutoGeneratingColumnEventArgs..::..Column 属性来访问 DataGridColumn 属性。// Modify the header of the Name column.if (e.Column.Header.ToString() == "Name") e.Column.Header = "Task";2. 替换生成的列a. 在 AutoGeneratingColumn 事件处理程序中,创建一个新的 Dat 阅读全文
posted @ 2011-03-14 20:20 南宫元耘 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 1. 创建定义行详细信息部分的外观的一个 DataTemplate。2. 将 DataTemplate 放入 <DataGrid.RowDetailsTemplate> 标记。<sdk:DataGrid x:Name="dataGrid1" Height="400" IsReadOnly="True" > <sdk:DataGrid.RowDetailsTemplate> <!-- Begin row details section. --> <DataTemplate> & 阅读全文
posted @ 2011-03-14 19:23 南宫元耘 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 添加MIME type: 阅读全文
posted @ 2011-03-14 15:08 南宫元耘 阅读(161) 评论(0) 推荐(0) 编辑