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

Fire event when clicking on the specific cell

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.