Datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
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]
 
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
 
Back
Top