Esempio n. 1
0
 private void LoadGrid2()
 {
     try
     {
         BLItem objBL = new BLItem();                                                      // declare and initialize BLItem object
         Studentinfo2.DataSource = objBL.GetStudent_University(Session["New"].ToString()); //setting data source for the gridview
         Studentinfo2.DataBind();                                                          //bind the data source to the gridview
         Studentinfo2.HeaderRow.Visible = false;
         Studentinfo2.BorderStyle       = BorderStyle.None;
         Studentinfo2.Rows[0].Visible   = false;
         for (int i = 0; i < Studentinfo2.Rows.Count; i++)
         {
             Studentinfo2.Rows[i].Cells[1].BorderStyle = BorderStyle.None;
             Studentinfo2.Rows[i].Cells[1].ForeColor   = Color.White;
             Studentinfo2.Rows[i].Cells[1].Font.Bold   = false;
         }
         for (int i = 0; i < Studentinfo2.Rows.Count; i++)
         {
             Studentinfo2.Rows[i].BorderStyle          = BorderStyle.None;
             Studentinfo2.Rows[i].Cells[0].BorderStyle = BorderStyle.None;
             Studentinfo2.Rows[i].Cells[0].ForeColor   = Color.Khaki;
             Studentinfo2.Rows[i].Cells[0].Font.Bold   = true;
         }
     }
     catch (SqlException)
     {
         throw;
     }
 }