473,491 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Click Event for TableRow?

Is there any way to create a click event for a TableRow? It doesn't seem to
be built in by default. If anyone knows how this can be implemented it would
be most appreciated.

Thanks,
Steve
Nov 17 '05 #1
3 2369
Ram
"Steve - DND" <steve!@!digitalnothing.com> wrote in message news:<#E**************@tk2msftngp13.phx.gbl>...
Is there any way to create a click event for a TableRow? It doesn't seem to
be built in by default. If anyone knows how this can be implemented it would
be most appreciated.

Thanks,
Steve


You can write a client side click event for a table row using javascript.

Thanks
Ram
Nov 17 '05 #2
Check out this article, here i have created onclick event for tablerow.
http://www.microsoft.com/india/msdn/...0DataGrid.aspx
or
http://www.extremeexperts.com/Net/Articles/default.aspx
--
Saravana
Microsoft India Community Star,MC**
www.ExtremeExperts.com

"Steve - DND" <steve!@!digitalnothing.com> wrote in message
news:#E**************@tk2msftngp13.phx.gbl...
Is there any way to create a click event for a TableRow? It doesn't seem to be built in by default. If anyone knows how this can be implemented it would be most appreciated.

Thanks,
Steve

Nov 17 '05 #3
Thanks Natty, that did the trick.

"Natty Gur" <na***@dao2com.com> wrote in message
news:OB**************@TK2MSFTNGP11.phx.gbl...
Hi,

yes, but you need to do it yourself.

1) Add client side javascript that will catch table clicks and check
using event.source if the type of the source element is TD. Then use
__DoPostBack('MyTRClickEvent','AnyParameter'). To indicate the server
side that your event needs to be raise.

2) Declare event in your page code behind. This event will occur on the
server side.
public event EventHandler TRClick;
3) In the Page_Init check if the value in the __EVENTTARGET field is
'MyTRClickEvent'. If so raise the event

if (this.Request.Form["__EVENTTARGET"] == "devnetmenu")
{
if (MenuClick != null) // check if event hanler declared
MenuClick(this,oEvent);
}

4) write your code in the event handler

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
13542
by: Assaf Weinberg | last post by:
Using ASP.NET web form with VB.NET I have a page with a calendar control that onSelectionChanged builds a table control showing the events scheduled for the selected calendar days. One of the...
0
2234
by: Jim Mitchell | last post by:
I have the code snippet below. I fill a table of imagebuttons and would like to know which one was clicked to trigger the post back. Unfortunately, the Command event does not fire unless I load...
3
36659
by: CodeRazor | last post by:
I am creating an aspx page using C# and would like to be able to dynamically create linkbuttons that all run the same fuction on the click event. However, I would like the function to accept a...
2
2081
by: Grant | last post by:
Below is the code I am using to build the table using system.web.ui.webcontrols.table. I am building a collection of link buttons inside each cell. How do I know when the user clicks on the link...
4
1512
by: News | last post by:
I have a page with many controls. Among these controls there is a table which is a datagrid with nested repeater inside. My problem is that I can not use DataGridCommandEventArgs to get datagrid...
2
4123
by: gce | last post by:
Allthough button2 created with the designer works 100%. The button I created (inside the table) with dim button1 as new button doesn't give me a click event. Please help. Public Class WebForm8 ...
0
2079
by: loga123 | last post by:
Hi All, I am very new to .net and trying to develop a small application. I am using asp .net 2.0. I have a table control (server) in my code that has header row like this. <asp:Table...
0
1880
by: OceanBreeze | last post by:
I have added a LinkButton to a table cell programmatically inside the Page_Load method. I also added a custom event to that link button. The same custom event is valid for all the link buttons. The...
5
6741
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
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
7190
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...
1
6858
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
7360
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...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.