Data - Highlight row

M

Mark Goldin

Is there a way to highlight the whole row in DataGrid?
I want to select a whole row clicking anywhere on that row.
I also want to prevent the user from selecting individual cells.
So when he clicks on the row the cell does not get activated.
Can someone help, please?
 
N

Nicholas Paldino [.NET/C# MVP]

Mark,

You could probably sign up for the click event in the data grid,
selecting the entire row when it is clicked (you would have to use the
HitTest method as well to find out what you clicked on).

As for not activating the cell, it sounds like you want to make the data
grid read only, which you can do by setting the ReadOnly property on the
data grid.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top