Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
here is my aspx code:

XML
<asp:GridView ID="GridViewStudentsList" runat="server" AutoGenerateColumns="False"
               BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3"
               CellSpacing="1" EmptyDataText="No Details Found" GridLines="None" OnPageIndexChanging="GridViewStudentsList_PageIndexChanging"
               PagerStyle-Font-Bold="true" PagerStyle-ForeColor="#000066" PageSize="5" Style="z-index: 101;
               left: 60px; position: absolute; top: 80px">
               <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
               <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
               <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
               <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
               <HeaderStyle BackColor="#000066" Font-Bold="True" ForeColor="#E7E7FF" />
               <Columns>
                   <asp:BoundField DataField="Sno" HeaderText="Sno" />
                   <asp:BoundField DataField="RollNo" HeaderText="RollNo" />
                   <asp:BoundField DataField="Name" HeaderText="Name" />
                   <asp:BoundField DataField ="Department" HeaderText ="Department" />
                   <asp:BoundField DataField ="Year" HeaderText ="Year" />

               </Columns>


           </asp:GridView>



And this is my aspx.cs:

C#
protected void GridViewStudentsList_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        try
        {
            GridViewStudentsList.PageIndex = e.NewPageIndex;
            FillStudentList();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }



C#
public void FillStudentList()
  {
      try
      {
          SqlAdapter = new SqlDataAdapter("select ''Sno,RollNo,Name,Department,StudentsAccounts.Year from StudentsAccounts inner join(select teacherid,Departmentid,dptName,year from TeachersWorkList inner join Departments on Departments.dptid=TeachersWorkList.departmentid Where Teacherid='" + HiddenFieldID.Value + "')As DptList On StudentsAccounts.Department=DptList.dptName And StudentsAccounts.Year=DptList.year where DptList.Departmentid='" + Session["MyDptID"].ToString() + "' And StudentsAccounts.Year='" + Session["Year"].ToString() + "' ", Connection);
          DataSet MyDataSetDetails = new DataSet();
          SqlAdapter.Fill(MyDataSetDetails, "TeachersWorkList");
          for (int i = 0; i <= MyDataSetDetails.Tables[0].Rows.Count - 1; i++)
          {
              MyDataSetDetails.Tables[0].Rows[i][0] = i + 1;
          }
          GridViewStudentsList.DataSource = MyDataSetDetails;
          GridViewStudentsList.DataBind();
      }
      catch (Exception ex)
      {
          throw ex;
      }
  }



Now i want to add a extra field mark..where i add a mark?? also in this grid view how can i provide marks for each student? anyone can help me??
Posted
Comments
Suresh Dasari's 24-Dec-12 6:27am    
where do you get the mark field,
can you place the table details related to the marks field.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900