1
Answer

error in rowdatabound

yogita dhingra

yogita dhingra

15y
3.2k
1
 foreach (GridViewRow row in GrdManageMember.Rows)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {

                    {
                        string SchemeDays = string.Empty;
                        SchemeDays = ((Label)e.Row.FindControl("lblPeriod")).Text;
                       if (SchemeDays == "90")
                        {
                            ((Label)e.Row.FindControl("sch_code")).Text = "3 months";
                        }
                        if (SchemeDays!=null && SchemeDays=="183")
                        {
       
                            ((Label)e.Row.FindControl("sch_code")).Text = "6 months";
                        }
                        if (SchemeDays == "365")
                        {
                            ((Label)e.Row.FindControl("sch_code")).Text = "12 months";
                        }
                    }

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

its giving error. i m not geting the data in column wht the wrong in this code can u plz tell me.

Answers (1)