Bhavleen Singh

Bhavleen Singh

  • NA
  • 203
  • 5k

Getting Cell value from Gridview

May 28 2019 11:39 PM
I've used template field approach
  <asp:TemplateField HeaderText="TReDS Status">
    <ItemTemplate>
        <asp:Label ID="lblTredsStatus" runat="server" Text='<%#Bind("STATUS")%>'></asp:Label>
    </ItemTemplate>
</asp:TemplateField>
 i want to fetch its value from c#(beckend)
I've already tried
{
GridViewRow row = grdPaymentrelease.Rows(e.RowIndex);
value = ((TextBox)row.FindControl("STATUS")).Text.ToString().Trim();
}
on rowdatabound function with e as System.Web.UI.WebControls.GridViewRowEventArgs
 
giving error - RowIndex is not a member of  e
 
instead I also tried  e As GridViewUpdateEventArgs
its asking to make new function
 
Help!

Answers (4)