Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.Net Datagrid get Cell Contents on mouse click or mouse down

Reply
Thread Tools

ASP.Net Datagrid get Cell Contents on mouse click or mouse down

 
 
Davisro
Guest
Posts: n/a
 
      04-23-2004
I would like to get the cell contents of an asp.net datagrid when the mouse
is down? Mouse Click, cell click etc...


Is there a way to get this?



Thanks,

Rog


 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      04-23-2004
about the easiest way to do this is to place the items ahead of time, tied
to the mousedown event handler from the itemdatabound using the attributes
of the cell object. Once the data is streamed to the page, you can access
the data because it is inside the page itself

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Davisro" <NA> wrote in message
news:(E-Mail Removed)...
>I would like to get the cell contents of an asp.net datagrid when the mouse
> is down? Mouse Click, cell click etc...
>
>
> Is there a way to get this?
>
>
>
> Thanks,
>
> Rog
>
>



 
Reply With Quote
 
 
 
 
Jim Corey
Guest
Posts: n/a
 
      04-23-2004


Rog,

In the ItemDataBound event of the datagrid you can do something like
this:

If e.Item.ItemType = ListItemType.Item Then
e.Item.Cells(1).Attributes.Add("onclick", "alert('hi')")
End If

You might also add ListItemType.AlternatingItem (this event also fires
for the header, and you don't want it there).

You could add in variables as needed.

HTH,
Jim



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reference Datagrid cell contents =?Utf-8?B?TXJNaWtl?= ASP .Net 3 03-11-2010 09:49 PM
This code requires the user 2 click the mouse twice, how do i do itin just one mouse-click? Daniish Javascript 2 06-13-2008 08:41 PM
Can you get a mouse over to work in a datagrid cell Craig G ASP .Net 1 02-01-2005 05:20 PM
Cell/td on mouse click event using ASP Carl Gilbert HTML 3 05-21-2004 12:21 AM
Cell/td on mouse click event using ASP Carl Gilbert ASP General 1 05-19-2004 09:57 PM



Advertisments