iblog 5

苹果有iphone,我有iblog

导航

2012年7月3日

摘要: 原因:DataGrid 的 EnableRowVirtualization 属性默认值是True,就是说动态加载数据,只实例化屏幕内可见的数据;行头的内容是通过绑定实现的,但是滚动刷新时传入的DataGridRow并不是实际位置的行,而是虚拟的,造成行头显示内容错乱;解决办法:方法1:设置EnableRowVirtualization=“False",简单易行,但系统资源的开销大方法2:http://blog.csdn.net/jickie/article/details/7088644。该方法未验证。 阅读全文

posted @ 2012-07-03 17:14 cbtech 阅读(1023) 评论(2) 推荐(1) 编辑

摘要: private void dataGrid1_LoadingRow(object sender, DataGridRowEventArgs e){ e.Row.Header = e.Row.GetIndex() + 1;}效果: 阅读全文

posted @ 2012-07-03 16:02 cbtech 阅读(289) 评论(0) 推荐(0) 编辑

摘要: 运行界面:前台代码: <Grid> <DataGrid AutoGenerateColumns="True" Height="211" HorizontalAlignment="Left" Margin="27,34,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="334" IsReadOnly="True"> <DataGrid.Columns&g 阅读全文

posted @ 2012-07-03 15:59 cbtech 阅读(1204) 评论(0) 推荐(1) 编辑

摘要: 前台代码:<Window x:Class="WpfApplication16.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Wp 阅读全文

posted @ 2012-07-03 10:46 cbtech 阅读(1919) 评论(0) 推荐(0) 编辑