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

asp:DataGrid ... how do I allow any click on the row to select an item

P: n/a
Hi,

First off .. I am very new to ASP.NET (.NET in general), so this may be a
very basic question.

I want the user to click anywhere on a row to select an item. I have seen
samples where I can add a LinkButton, but I would prefer the user to click
anywhere on the row. Any ideas would be appreciated.

Thanks in advance,
John
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
John,

You need to handle ItemDataBound event on the server side. The events is
fired for every row (item) in the grid. Ignore non-data items like the
header and the footer. For the data items set attribute "onclick" to
"myOnClickHandler(this)", where myOnClickHandler is a client-side javascript
function. Inside this function you can set the row style to whatever you
want

Eliyahu

"John" <Pl****@reply.to.group.com> wrote in message
news:lF********************@news20.bellglobal.com. ..
Hi,

First off .. I am very new to ASP.NET (.NET in general), so this may be a
very basic question.

I want the user to click anywhere on a row to select an item. I have seen
samples where I can add a LinkButton, but I would prefer the user to click
anywhere on the row. Any ideas would be appreciated.

Thanks in advance,
John

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.