By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,608 Members | 3,801 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,608 IT Pros & Developers. It's quick & easy.

Highlight gridview row when clicked

P: n/a
J
I'm trying to highlight a gridview row when it is clicked. Because the
gridview is populated via ajax, adding attributes using OnRowCreated doesn't
work. How can I best accomplish this? Thanks.
Aug 1 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Could you provide a little more detail (like how you are populating the
gridview via ajax) - -
You say you want to hightlight a row when it is clicked - this can easily be
accomplished with the formatting properties of the SelectedRowStyle

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"J" <no****@nowhere.comwrote in message
news:jY******************************@posted.nuvox communications...
I'm trying to highlight a gridview row when it is clicked. Because the
gridview is populated via ajax, adding attributes using OnRowCreated
doesn't work. How can I best accomplish this? Thanks.

Aug 1 '08 #2

P: n/a
J
The users fills in a textbox then clicks a 'Search' button. The datasource
is then created and bound to the gridview with a dynamically created Select
statement. The datagrid is then displayed with the results (inside of an
ajax updatepanel).

If I have the gridview settings as such:
AutoGenerateSelectButton="True"
SelectedRowStyle BackColor="Red"
Clicking on the 'select' link won't change the background color to red.

"David Wier" <dw@dw.comwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
Could you provide a little more detail (like how you are populating the
gridview via ajax) - -
You say you want to hightlight a row when it is clicked - this can easily
be accomplished with the formatting properties of the SelectedRowStyle

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with
no bloated markup
"J" <no****@nowhere.comwrote in message
news:jY******************************@posted.nuvox communications...
>I'm trying to highlight a gridview row when it is clicked. Because the
gridview is populated via ajax, adding attributes using OnRowCreated
doesn't work. How can I best accomplish this? Thanks.


Aug 1 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.