Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 3rd, 2006, 01:10 PM
Authorized User
 
Join Date: Jan 2006
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default Select gridview record with mouseclick

How might it be possible to select a gridview record with a mouse click?

I'm building a gridview that will use custom column templates. I recognize that gridview provides a "select" button feature. However, I'd like to be able to select a particular record
by having the user click anywhere on the custom column template. (Reason is I'm then going to show a context menu).

I think this breaks down into two parts: sensitizing the template for clicks (by enabling events for it), and then associating the click with a record identifier of some kind (which

would be in a control in the gridview record, if not in the column template itself), so I can tell which record was clicked. (It doesn't have to be relative position in the gridview, just the

record id from the record would be sufficient....using relative row position would seem to be a very long path to get the information...%-}

If I have to sensitize all the controls within the template, as well as the template itself,(because maybe the controls would "block" the template) that would be ok, as long as I could still figure out which record was clicked on.

Any guidance on this would be appreciated.

Thanks!
 
Old March 9th, 2006, 12:09 PM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've been looking for a similar solution. I have not found the perfect answer yet. However, this blog post may be helpful:
http://blogs.parivedasolutions.com/b...eGridView.aspx

Note that you still need to have a select button on the grid for this to work.
 
Old March 9th, 2006, 01:44 PM
Authorized User
 
Join Date: Jan 2006
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the note. In my app I'm handling the row click event in the client, so it might work. However, I also decided that the row click was not as "clear" for my particular user group as a GUI guesture, so I went with a client-side select button. It's good to see that row click might be possible, though, and the insight into setting an attribute in _RowDataBound was useful for my newbie knowledge base. Grazie!





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to select the particular record? azymd777 ASP.NET 2.0 Professional 1 August 8th, 2008 05:55 AM
Select row in GridView WITHOUT using Select button rao965 ASP.NET 2.0 Professional 1 February 15th, 2008 10:44 AM
MouseClick in internet Explorer silvie Excel VBA 0 July 21st, 2007 04:01 PM
gridview select tothemaxm ASP.NET 2.0 Basics 3 April 26th, 2006 03:17 PM
Problem with: Add new record in GridView kalchev ASP.NET 2.0 Basics 0 April 26th, 2006 07:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.