Jaya Prakash

Jaya Prakash

  • 511
  • 2.3k
  • 65k

row.Cells[0].Text;

May 4 2023 4:10 AM

here in the 10th line i'm not getting any value when im trying to find row index and its value pls help me to solve 

protected void lnkbtnView_Click(object sender, EventArgs e)
{
    try
    {
        LinkButton button = sender as LinkButton;
        DataTable dt = new DataTable();
        int rowindex = Convert.ToInt32(button.CommandArgument.ToString());

        GridViewRow row = grdvwMerchantBanks.Rows[rowindex];
        string BenID = row.Cells[0].Text;
        long UserId = long.Parse(BenID);
        dt = obank.GetdetailsInPop(UserId);

        lblBenId.Text = dt.Rows[0]["BeneficiaryID"].ToString();
        lblBenCode.Text = dt.Rows[0]["BeneficiaryCode"].ToString();
        lblBenName.Text = dt.Rows[0]["BeneficiaryName"].ToString();
        lblAccountNumber.Text = dt.Rows[0]["AccountNumber"].ToString();
        lblIFSC.Text = dt.Rows[0]["IFSC"].ToString();
        lblNameAsPerBank.Text = dt.Rows[0]["NameAsPerBank"].ToString();

        ScriptManager.RegisterStartupScript(UPDP_MerchantBanks, UPDP_MerchantBanks.GetType(), "ErrorMSg", "<script>ShowMainDialog();</script>", false);
    }
    catch (PayException PayException)
    {
        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "ErrorMSg", "<script>ShowErrorDialog('" + PayException.Message.ToString() + "')</script>", false);
    }
    catch (Exception ex)
    {

        oExceptionManager.LogError(ex.Message, " -- In  lnkView_Click Function in Users.aspx.cs");
    }
}

 


Answers (2)