473,395 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 2059
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gerg | last post by:
The datagrid has a tablestyle applied to it, and there are DataGridTextBoxColumn and each DataGridTextBoxColumn has an array of DataGridTextBox objects. Private Sub highlight(ByVal str As...
7
by: Bob | last post by:
I've done this before, but can't find the simple code that allows this. I have a multiple item drop down created in a form with FrontPage 2002. I want to highlight or bold selected items, but...
2
by: Steve K | last post by:
Firstly, how the heck does this guy do it? Writing reams of (awesome) code, debugging, responding to Newsgroups etc., all while commanding the ridiculous price of FREE?!?!?! More power to him! ...
0
by: Sean | last post by:
Hi, I am doing a desktop application and now I am having problem preventing the quick highlight of a treenode when a user right clicks a treenode. The reason I am doing this is that only when...
6
by: LU | last post by:
A)I build a datagrid based on a calendar date selection. B)When user clicks a button column on the datagrid I want to highlight this row. I use the code below to highlight the row. ***** CODE...
9
by: Devron Blatchford | last post by:
Hi there, Just wondering if I change the back and fore colour of a listview item when the mouse hovers over it? I want to overide the default windows colour. Can someone please tell me how to...
5
by: Atara | last post by:
I am trying to convert the following code to VB .Net, I still have some gaps (the lines that are marked with (*)) and also I need an ending condition for the while loop. any help would be...
2
by: Number 11950 - GPEMC! Replace number with 11950 | last post by:
When you highlight a selection of text represented in an object on a form, somewhere in the Framework or alternatively in the Windows API there exists an array of variables that either contain as a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.