Click here to Skip to main content
16,011,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to get grid cell value in asp.net


XML
<asp:TemplateField HeaderText="Amount">
<itemtemplate>
     <asp:Label ID="lblPackAmount" runat="server" Text='<%#Eval("PackageAmount")%>' 
</itemtemplate>
Posted
Updated 6-Dec-13 0:48am
v2
Comments
Siva Hyderabad 6-Dec-13 6:05am    
dt.Rows[0]["column name"].ToString();
Member 10339067 6-Dec-13 6:08am    
if (Checkbox is checked)
i need to take checked values only

1 solution

C#
If it's a BoundField you could do

gv.Rows[1].Cells[1].Text;
If it's a TemplateField, you have to get the control that has the value you want.

Label L = gv.Rows[1].FindControl("yourcontrolId") as Label;
L.Text;
 
Share this answer
 
Comments
Member 10339067 6-Dec-13 6:43am    
thank u
Karthik_Mahalingam 6-Dec-13 7:10am    
this will work fine..

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