Click here to Skip to main content
12,549,003 members (47,520 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET
here is my aspx code:

<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" />
                   <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" />


And this is my aspx.cs:

protected void GridViewStudentsList_PageIndexChanging(object sender, GridViewPageEventArgs e)
            GridViewStudentsList.PageIndex = e.NewPageIndex;
        catch (Exception ex)
            throw ex;

public void FillStudentList()
          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;
      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 22-Dec-12 0:05am
SureshDasari1986 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161021.1 | Last Updated 22 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100