1
Answer

Fix It

Ask a question
Ahmed Ali

Ahmed Ali

11y
874
1
hi

Input string was not in a correct format.

my code is 

  protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
               
                    int val=int.Parse((e.Row.Cells[7].ToString ()));
                if ( val >= 100000)
                {

                    e.Row.BackColor = System.Drawing.Color.Maroon ;
                    e.Row.ForeColor = System.Drawing.Color.White;
                }
                if((val>=50000)&&(val<=100000))
                {
                    e.Row.BackColor=System.Drawing.Color.Beige;
                    e.Row.ForeColor=System.Drawing.Color.Black;

                }
                if(val<=50000)
                {

                    e.Row.BackColor=System.Drawing.Color.DarkBlue ;
                    e.Row.ForeColor=System.Drawing.Color.White;

                }
            }
        }

Answers (1)