Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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. . .
Posted

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 [^]
 
Share this answer
 
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.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900