473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Fire event when clicking on the specific cell

i wants that the Event would fie when we click on DataGrid using Asp.net without using any select command or hyperlink. i just want that user click on the specific cell of datagrid then the even occurs for cell and tell us which cell have, we click
thanx
tenzeel.
Nov 18 '05 #1
2 1472
Please don't ask the same question 10 times! You have received many answers.

--
John Saunders
johnwsaundersiii at hotmail
"tenzeel." <te*****@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com...
i wants that the Event would fie when we click on DataGrid using Asp.net without using any select command or hyperlink. i just want that user click
on the specific cell of datagrid then the even occurs for cell and tell us
which cell have, we click thanx
tenzeel.

Nov 18 '05 #2
In order to add click event to the entire row of datagrid, add a link button as a hidden column to the datagrid and then in ItemDataBound event of datagrid, we can attribute the link click event to the entire row in the following way :
//Get the link button
LinkButton lnkButton = (LinkButton)grdEventArgs.Item.Cells[0].Controls[0];

// add the click event to the entire list item
grdEventArgs.Item.Attributes["onclick"] = Page.GetPostBackClientHyperlink(lnkButton, "");

thats it..when the user clicks on the row, the row is selected and SelectedIndex event is fired which we can catch in the code behind and get the SelectedIndex value.
hope this answers you.
Nov 18 '05 #3

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

Similar topics

1
by: Jean-Francois Larvoire | last post by:
Hi, I wrote code to highlight cells in an HTML table when the mouse flies over them. The code works well, except for a strange problem: When the mouse enters a cell, I get 3 events for the...
7
by: Gordon Smith | last post by:
I have four (4) ASP.NET Web applications/Web sites on a IIS/6 - Windows Server 2003 production server. 3 of them work fine. I just installed the 4th one and it's Application_Start event is not...
11
by: OldProgrammer | last post by:
All the documentation and discussion I have read indicate that the Session_End is not supposed to fire unless you are in "inProc" Session state mode, and then only on Session Timeout or at Session...
2
by: Li Pang | last post by:
Hi, I used a datagrid control to populate the data, and used DataGrid.Click or DataGrid.DoubleClick events to handle a function. However, the event is only fired when clicking on the NON-DATA...
10
by: shiry | last post by:
Hi, I need to do some important cleanup before my console application exists. I used the console ctrl event. This is working well and it fires for all cases, including the CTRL_CLOSE_EVENT (if I...
2
by: Ryan Liu | last post by:
Hi, I need the MouseDown event be trigged everytime when you press mouse in a datagrid (System.Windows.Forms). But seems mouse event will only fire once, and it seems changed to edit mode...
1
by: Ryan Liu | last post by:
Hi, I need the MouseDown event be trigged everytime when you press mouse in a datagrid (System.Windows.Forms). Hi, I need the MouseDown event be trigged everytime when press mouse in a...
2
by: =?Utf-8?B?UmljaA==?= | last post by:
Hello, When clicking on the top left corner of a datagridview - then entire contents of the datagridview is selected. When clicking on that cell - what event gets triggered/fired? I tried...
2
by: Joergen Bech | last post by:
Hope someone has a solution or some suggestions for this. This cannot be right?!? Problem: I have multiple non-modal forms open at the same time. One or more of these forms have a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.