Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
Please Help
posted

I have normal grid in ASP.NET and I am converting it into webdata grid.

Now my grid has functionalities of opening file, copy file, edit description of file, emailing file and deleting file.

It is based on documents.

Now suppose if I take example of deleting file the original code is:

  protected void lbEmailDocument_Click(object sender, CommandEventArgs e)

    {

        int index = Int32.Parse(e.CommandArgument.ToString());

        Session["strDocumentToAttach"] = ((Label)gvDocuments.Rows[index].Cells[0].FindControl("lblPath")).Text;

        Session["strSubject"] = "Case Document E-mail (Case # " + lblCaseNumber.Text.Trim() + ")";

        Session["strNote"] = "Please find the attached document " + ((Label)gvDocuments.Rows[index].Cells[0].FindControl("lblFileName")).Text;

        ScriptManager.RegisterStartupScript(Page, this.GetType(), "myPopUp", "<script language='Javascript'>mywin=window.open('Case_Email.aspx?CaseID=" + lblCaseID.Text + "', '', 'location=0,status=0,resizable=1,scrollbars=1,height=920px, width=1250px');mywin.moveTo(0,0);</script>", false);

 

        // Response.Redirect("Case_Email.aspx?CaseID=" + lblCaseID.Text);

    }

 

------------------------------------------------------------------------------------------------------------------------------

Now when I change this : Instead of Rows[index].Cells[0] I am not able to access the cell value.

 

Please guide me through, How to change it.