Click here to Skip to main content
15,891,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have gridview and i have template field.
there is label in itemtemplate and i have bind it to the field "Party_Name"
now i want to get this field name "Party_Name".
i don't want the value of "Party_Name".
i just want the field name "Party_Name" which i bound to label.
kindly help me.
Posted
Comments
zyck 8-Feb-12 2:05am    
can you post your code and sample output
Member 8589824 8-Feb-12 3:14am    
<asp:TemplateField HeaderText="PartyName">
<itemtemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Party_Name") %>'>



i want to retrieve "Party_Name" programatically. not the value of "Party_Name".. i just want the field name "Party_Name" which i bound with lable.

 
Share this answer
 
Comments
Member 8589824 8-Feb-12 3:14am    
<asp:TemplateField HeaderText="PartyName">
<itemtemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Party_Name")%>'>



i want to retrieve "Party_Name" programatically. not the value of "Party_Name".. i just want the field name "Party_Name" which i bound with lable.
Hi,

You can use this.

((Label)lvwRnb.FindControl("lbl_ItemTemplate")).Text = "Party_Name";

I hope this one can help.

Thank You.
 
Share this answer
 
Comments
Member 8589824 8-Feb-12 3:03am    
no i don't want text of label. i want the field name which i have bound to it
Member 8589824 8-Feb-12 3:15am    
<asp:TemplateField HeaderText="PartyName">
<itemtemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Party_Name") %>'>



i want to retrieve "Party_Name" programatically. not the value of "Party_Name".. i just want the field name "Party_Name" which i bound with lable.
SayreCC 8-Feb-12 20:36pm    
Can you post your snippets and determine to us what output you want.

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