6 个解决方案
#1
顶~
#2
listView的GridLines属性改成true
#3
顶!并推荐一个好地方!http://hi.baidu.com/happyf101
希望大家支持一下!
希望大家支持一下!
#4
这个问题不好弄。我的办法是重写GridViewColume.CellTemplate,为每个Cell加上一个框。
#5
<ScrollContentPresenter Name="PART_ScrollContentPresenter"
KeyboardNavigation.DirectionalNavigation="Local">
<ScrollContentPresenter.Content>
<Grid>
<ItemsControl Margin="3,0,0,0" ItemsSource="{Binding Path=TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Width="{Binding Path=ActualWidth}" BorderThickness="0,0,1,0" BorderBrush="{DynamicResource verticalLineColor}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<ContentControl Content="{TemplateBinding Content}" />
</Grid>
</ScrollContentPresenter.Content>
</ScrollContentPresenter>
KeyboardNavigation.DirectionalNavigation="Local">
<ScrollContentPresenter.Content>
<Grid>
<ItemsControl Margin="3,0,0,0" ItemsSource="{Binding Path=TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Width="{Binding Path=ActualWidth}" BorderThickness="0,0,1,0" BorderBrush="{DynamicResource verticalLineColor}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<ContentControl Content="{TemplateBinding Content}" />
</Grid>
</ScrollContentPresenter.Content>
</ScrollContentPresenter>
#6
到了WPF 3.5,算是用WPF Toolkit里的DataGrid解决了问题:-)
#1
顶~
#2
listView的GridLines属性改成true
#3
顶!并推荐一个好地方!http://hi.baidu.com/happyf101
希望大家支持一下!
希望大家支持一下!
#4
这个问题不好弄。我的办法是重写GridViewColume.CellTemplate,为每个Cell加上一个框。
#5
<ScrollContentPresenter Name="PART_ScrollContentPresenter"
KeyboardNavigation.DirectionalNavigation="Local">
<ScrollContentPresenter.Content>
<Grid>
<ItemsControl Margin="3,0,0,0" ItemsSource="{Binding Path=TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Width="{Binding Path=ActualWidth}" BorderThickness="0,0,1,0" BorderBrush="{DynamicResource verticalLineColor}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<ContentControl Content="{TemplateBinding Content}" />
</Grid>
</ScrollContentPresenter.Content>
</ScrollContentPresenter>
KeyboardNavigation.DirectionalNavigation="Local">
<ScrollContentPresenter.Content>
<Grid>
<ItemsControl Margin="3,0,0,0" ItemsSource="{Binding Path=TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Width="{Binding Path=ActualWidth}" BorderThickness="0,0,1,0" BorderBrush="{DynamicResource verticalLineColor}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<ContentControl Content="{TemplateBinding Content}" />
</Grid>
</ScrollContentPresenter.Content>
</ScrollContentPresenter>
#6
到了WPF 3.5,算是用WPF Toolkit里的DataGrid解决了问题:-)