Click here to Skip to main content
15,902,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using web application.
in that i have gridview.
In grid view i am using two / there CommandFields

once i click on CommandField1/CommandField2... i have to know what is that column headtext.

i am giving example.
i am using vb
<asp:HyperLinkField HeaderText="Plan1" Text="Plan1" NavigateUrl="~/PlanPopup1.aspx" Visible="False" /> <asp:CommandField ShowSelectButton="True" HeaderText="Plan1" SelectText="Plan1"/>

<asp:HyperLinkField HeaderText="Plan2" Text="Plan2" NavigateUrl="~/PlanPopup1.aspx" Visible="False" />
<asp:CommandField ShowSelectButton="True" HeaderText="Plan2" SelectText="Plan2"/>

In this i have two commandFields. i.e is plan1 and plan2 once i click on plan1 column i should get the plan1 header text.
Updated 27-Jul-12 20:08pm

1 solution

There's an object passed in to your event. Check what it is, perhaps you can cast it to work out which button it was ( you should be able to ). Also check the eventargs on the event, if it's not an EventArgs, but a derived class, it's derived to give you the info you want.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900