469,950 Members | 1,938 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Highlight a selected row

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.
Dec 27 '05 #1
2 1935
For the “ButtonColumn” attempt to set the “CommandName” property to a
"Select" value.

Alexey Borzenkov (http://alexborzenkov.iespana.es/)

"Sridhar" wrote:
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.

Dec 27 '05 #2
Thanks alot. I have been trying this since the morning.

"Alexey Borzenkov" wrote:
For the “ButtonColumn” attempt to set the “CommandName” property to a
"Select" value.

Alexey Borzenkov (http://alexborzenkov.iespana.es/)

"Sridhar" wrote:
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.

Dec 27 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Steve K | last post: by
6 posts views Thread by LU | last post: by
9 posts views Thread by Devron Blatchford | last post: by
2 posts views Thread by Number 11950 - GPEMC! Replace number with 11950 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.