DataGrid样式在不同的计算机中更改 [英] DataGrid style changes in different computers

查看:74
本文介绍了DataGrid样式在不同的计算机中更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了在不同计算机之间更改的dataGrid样式的问题。

在特定场景中:从代码中选择一行,我们手动将选择更改为另一行。在一台计算机中,只选择第二行(应该如此),在另一台计算机中,似乎选择了前一行和当前行(即使在调试时我们只能看到第二行被选中,并且第一行仅在选中时显示)。

我怀疑前一行标记为true的某些属性,样式类似于选择样式。任何想法这个属性可能是什么?为什么它在不同的计算机中表现不同?

解决方案

如果给出固定大小,Datagrid将在不同的计算机中呈现不同。你需要使用这样的东西



 <   window     xmlns:ctrl   =  clr-namespace:Itenso.Windows.Controls.ListViewLayout; assembly = Itenso.Windows.Controls.ListViewLayout >  

< gridview >
< gridview.columns >
< gridviewcolumn ctrl:rangecolumn.minwidth = 50 width = 50 ctrl:rangecolumn.maxwidth = 50 >
< / gridviewcolumn >
< / gridview.columns >
< / gridview >
< / window >


I have a problem with a dataGrid style that changes between different computers.
In a specific scenario: One row is selected from the code and we change the selection to a different row manually. In one computer only the second row is selected (as it should), in a different computer, it seem like both the previous row and the current row are selected (Even though when debugging we can see only the second row is selected, and the first row is only presented as it is selected).
I suspect there is some property the previous row is marking as true, and the style is similar to the selection style. Any Idea what this property might be? And Why does it presented differently in different computers?

解决方案

Datagrid will present differently in different computers if you give a fixed size. you need to use something like this

<window xmlns:ctrl="clr-namespace:Itenso.Windows.Controls.ListViewLayout;assembly=Itenso.Windows.Controls.ListViewLayout">

 <gridview>
  <gridview.columns>
   <gridviewcolumn ctrl:rangecolumn.minwidth="50" width="50" ctrl:rangecolumn.maxwidth="50">
   </gridviewcolumn>
 </gridview.columns>
</gridview>
</window>


这篇关于DataGrid样式在不同的计算机中更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆