G
geronimi
I want to create a linkbutton in a cell because not every row needs one
(so I can't setup a linkbuttoncolumn instead of a boundcolumn.)
First, i create a linkbutton in the datagrid_ItemDataBound :
Dim linkButton As New LinkButton
linkButton.Text = name
linkButton.CommandName = "PassSelectedClient"
linkButton.CommandArgument = id
I add it to the controls
e.Item.Cells(0).Controls.Add(linkButton)
Everything is done well, but I need something to catch the click!
I tried to add WithEvents but it can not be done with Dim
So i created this as a global: Protected WithEvents linkButton As New
KeepIT.WEBGUI.Controls.dcaLinkButton, but then my page is not rendered
well (only the last row contains a link
)
How can I make it work with the click?
(so I can't setup a linkbuttoncolumn instead of a boundcolumn.)
First, i create a linkbutton in the datagrid_ItemDataBound :
Dim linkButton As New LinkButton
linkButton.Text = name
linkButton.CommandName = "PassSelectedClient"
linkButton.CommandArgument = id
I add it to the controls
e.Item.Cells(0).Controls.Add(linkButton)
Everything is done well, but I need something to catch the click!
I tried to add WithEvents but it can not be done with Dim
So i created this as a global: Protected WithEvents linkButton As New
KeepIT.WEBGUI.Controls.dcaLinkButton, but then my page is not rendered
well (only the last row contains a link
![Frown :( :(](/styles/default/custom/smilies/frown.gif)
How can I make it work with the click?