Datagrid

G

Guest

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?
 
C

Cor Ligthert [MVP]

Sunil,

Not that you are not welcome here, however I give you a better change on
this answer in language newsgroup as
dotnet.languages.vb or csharp

If it is for VB.Net than I thought that I had seen Ken doing such a thing,
however I am completely unsure about it because I don't see it on our
website. Ken is active in languages.vb

http://www.vb-tips.com/default.aspx

It is not much, however I hope it helps something,

Cor
 
S

S.M. Altaf [MVP]

In the ItemDataBound event, set the Backcolor property for the cell by first
identifying the selected row, possibly by comparing the first cell's value
with your own value (your mechanism), and then for each cell in that row,

e.Item.BackColor = System.Drawing.Color.Yellow

HTH
-Altaf [MVP]
 
C

Cor Ligthert [MVP]

Altaf,

Do you have any problem if I try it some day and than put it as a sample
(refering to you) on our website?

(While I don't know if it is already there, those selects are most (not all)
done by Ken, than I don't do it of course)

Cor
 

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