Link to home
Start Free TrialLog in
Avatar of starlite551
starlite551Flag for India

asked on

How Do I Programatically Bind a ItemTemplate's LinkButton Control To The Primary Key Column In a GridView Control?

When I click on a link button next to each row in the GridView it should show the details of that entry in a DetailsView. For this purpose I added an ItemTemplate to GridView which further has a LinkButton in it.. So i need the complete code as to how i can link this LinkButton next to each row of the GridView to the primary key column of the Table displayed in GridView control. Please specify complete source code or any link related to this topic.Thanks :). Code will be most appreciated
ASKER CERTIFIED SOLUTION
Avatar of Kaushal Arora
Kaushal Arora
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In the second method you cannot use the selectedindexchanging event. i have written it by mistake. You can use the row updating event in that method. i am attaching the code for the 1st method.

Hope it helps.
Default2.aspx
Default2.aspx.cs
Avatar of starlite551

ASKER

Hey Thats good but I wanted the solution using a LinkButton if u have that.. Can u plz post the LinkButton version of the code..??
I have used the linkbutton in the code i have given you. Kindly check that.
ok i didn`t notice that one.. thanks :)