Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am displaying a grid view as shown below. Now i want Id to be bound with name field so that i when i click name link it will display details of the employees.


Name Address Age

ABC sdsd 45
XYZ asdsd 34


When i click on ABC or XYZ i must display details. So inorder to do that i must bind (id) on the Name column..How can i do that???
Posted
Comments
[no name] 28-Nov-12 10:36am    
Make name field as Hyperlink
Arjun Menon U.K 28-Nov-12 10:39am    
Can u elaborate?? This is the current code i am using
<columns>
<asp:TemplateField HeaderText="Name">
<itemtemplate>
<asp:LinkButton ID="lnkName" runat="server" Text='<%# Eval("name")%>' >

<asp:TemplateField HeaderText="Address">
<itemtemplate>
<asp:Label ID="lblAge" runat="server" Text='<%# Eval("age")%>'>

<asp:TemplateField HeaderText="Age">
<itemtemplate>
<asp:Label ID="lblAddress" runat="server" Text='<%# Eval("address")%>'>

[no name] 28-Nov-12 10:40am    
I have provided some links below.. Perhaps that will help you..

1 solution

 
Share this answer
 
Comments
Arjun Menon U.K 28-Nov-12 10:43am    
Thanks a lot Krunal

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