How to determine which cell was clicked in as ASP.NET DataGrid
From: Daniel Walzenbach (daniel.walzenbach.NOSPAM_at_freudenberg.de)
Date: 06/01/04
- Next message: Justin Dyer: "Accessing value of bound column at run time"
- Previous message: Christian: "Accessing the current datasource row and column?"
- Next in thread: John Saunders: "Re: How to determine which cell was clicked in as ASP.NET DataGrid"
- Reply: John Saunders: "Re: How to determine which cell was clicked in as ASP.NET DataGrid"
- Reply: Steven Cheng[MSFT]: "RE: How to determine which cell was clicked in as ASP.NET DataGrid"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 2 Jun 2004 00:12:59 +0200
Hi,
I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchTopQuestionsAboutASPNETDataGridServerControl.asp, Selecting Rows by Clicking Anywhere).
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) _
Handles DataGrid1.ItemDataBound
Dim itemType As ListItemType = e.Item.ItemType
If ((itemType = ListItemType.Pager) Or _
(itemType = ListItemType.Header) Or _
(itemType = ListItemType.Footer)) Then
Return
Else
Dim button As LinkButton = _
CType(e.Item.Cells(0).Controls(0), LinkButton)
e.Item.Attributes("onclick") = _
Page.GetPostBackClientHyperlink(button, "")
End If
End Sub
Additionally I want to be able to know which cell was clicked. Does anybody know how this can be done?
Thank you a lot in advance!
Daniel
- Next message: Justin Dyer: "Accessing value of bound column at run time"
- Previous message: Christian: "Accessing the current datasource row and column?"
- Next in thread: John Saunders: "Re: How to determine which cell was clicked in as ASP.NET DataGrid"
- Reply: John Saunders: "Re: How to determine which cell was clicked in as ASP.NET DataGrid"
- Reply: Steven Cheng[MSFT]: "RE: How to determine which cell was clicked in as ASP.NET DataGrid"
- Messages sorted by: [ date ] [ thread ]