Highlight a selected row

G

Guest

Hi,

I have a datagrid which contains 3 columns. Two of them are Bound Column
types and the third one is Button Column. When I click on one of the rows in
that Button Column, I would like to highlight that row. I have already set
the SelectedItemStyle property in the designer But I am knowing when it will
work. It is not highlighting the row. If I highlight the row inside the
datagrid1_ItemCommand event using e.Item.BackColor =
datagrid1.SelectedItemStyle.BackColor, e.Item.ForeColor =
datagrid1.SelectedItemStyle.ForeColor then it is highlighting the row but the
problem is when I click on another row it is not removing the highlighted
colors from the previously selected row. It is highlighting all the rows that
were clicked until then. please let me know how to do that.

Thanks,
Sridhar.
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top