ASP.NET Gridview botton / link column

Hello,

I have a VB application using a gridview that is being populated from a datatable in the backend. I am not using autogeneratecolumns and have manually specified all columns. 9 of them are standard read-only columns and three of them I want to contain data but also be clickable. I want each of these three clickable columns to fire an event so I can pass the value in the column the user clicked onto another page.

For example if the user clicks on the second clickable column it fires an event that gets the data from the exact same column they clicked on. I have it so I can get the row that was clicked but in this case I need the exacy column.

Is this possible?

Thanks in advance and regards.
LVL 1
rite_ehAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

satheeshmCommented:
User button filed for clickable columns like below

<asp:ButtonField CommandName="test1" Text="bind datatables column" />
            <asp:ButtonField CommandName="test2" Text="bind datatables column" />
            <asp:ButtonField CommandName="test3" Text="bind datatables column" />

and in code behind create event for datagrid row comannad as below. In this event check for command name and do the process.

Protected Sub grdCuttings_RowCommand(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewCommandEventArgs ) Handles
grdCuttings.RowCommand
If e.CommandName = "test1" Then
'I do my stuff here
elseif If e.CommandName = "test2" Then
'do process for test2
End If
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rite_ehAuthor Commented:
Excellent, exactly what I was after! I figured there was some property of the column I was overlooking.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.