在鼠标悬停并单击Silverlight数据网格时禁用行高亮显示 [英] Disable row highlighting on mouse over and click of a silverlight datagrid

查看:92
本文介绍了在鼠标悬停并单击Silverlight数据网格时禁用行高亮显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

Silverlight Datagrid具有一个功能,即默认情况下在鼠标悬停并单击事件时突出显示一行.就我而言,我不想突出显示行,因为在这里网格仅用于显示一些信息(只读).谁能帮我.提前致谢. . .

Hi everyone,

Silverlight datagrid has a feature of highlighting a row on mouse over and click events by default. In my case, i don''t want to highlight the rows, because here the grid is being used just to display some info(read-only). Can any one help me. Thanks in advance. . .

推荐答案

要删除突出显示,您需要将样式应用于网格的单元格和行. CellStyle:该属性将删除当前所选单元格周围的浅蓝色突出显示
RowStyle:该属性是您可以删除指示所选行的浅蓝色阴影的属性.

请参阅:如何删除Silverlight数据网格中的鼠标悬停突出显示和选定行突出显示 [轻松禁用Silverlight DataGrid的行选择 [ ^ ]
For removing the highlighting, you need to apply styles to cell and rows of grid.
CellStyle: property is the one which will remove the light blue highlight around the currently selected cell
RowStyle: property is the one where you will be able to remove the light blue shade indicating the selected row.

Refer: How to remove the mouseover highlight and selected row highlight in a Silverlight datagrid[^]


For removing click:
Set IsReadOnly to true to disable editing.

Another blog entry talking on similar thing: Easily Disable Row Selection for a Silverlight DataGrid [^]


您可以将IsReadOnly属性设置为True.这样,您可以禁用事件并取消行甚至列的突出显示.

您可以在DataGrid上应用一些样式,但是我认为这对于您的情况是不必要的.

希望对您有所帮助.
You can set the IsReadOnly property to True. That way you can disable events and cancel the highlight of the row, even columns.

You can apply some Styles on the DataGrid, but I think is unnecessary for your scenario.

Hope it helps.


这篇关于在鼠标悬停并单击Silverlight数据网格时禁用行高亮显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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