Gradebook Grid Display & Editing Question

6 posts, 0 answers
  1. Aiden James-Anthony
    Aiden James-Anthony avatar
    1 posts
    Member since:
    Sep 2015

    Posted 28 Sep 2015 Link to this post

    Hello everyone,

    I am a developing a Learning Management System solution incorperating online quizzes, assessments, assignment calendar, inbox messaging, attendance & grade recording.

    The hardest task I am encourneting is getting my gridview to function & display as a traditional gradebook (somewhat like an excel spreadsheet). My SQL tables are setup as followed:

    Students:

    ID (Primary key)
    Last Name (Varchar(50))
    First Name (Varchar(50))
    StudentID(int)
    Email(string)
    Username(String)
    Password

    Assignments:

    ID(PrimaryKey)
    AssignmentTitle(String)
    GradingCategory(int) *Linked to grading categories table
    ClassID(int)*Linked to Courses table's ID
    DueDate(Date)
    MaxPoints(int)
    Description

    Grades:

    GradeID(PrimaryKey)
    StudentID(int)*Linekd to "Students" table primary key
    Class ID(int)*Linked to "Assignments" table primary key
    Grade(string)
    Feedback(varchar(max))

     

    What i want to do is setup a grid that takes the information from the related tables and displays them as a traditional gradebook for editing and updating.

    (i.e.)
                            Assignment 1                Exam 1                
    Student 1              55                              B-
    Student 2              87                              A
    Student 3              92                              C+

    I'd like the user to be able to click on a grade cell and edit the data and update changes. I'm assuming the gridview or List View would accomplish this but I need help setting up this layout. Any help or guidance for this project would be greatly appreciated :)

    Thank you in advanced

     

     
  2. Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 01 Oct 2015 Link to this post

    Hi,

    Could you please elaborate more on what problems exactly are you experiencing in the implementation process?

    I strongly suggest examining our data editing section of the grid which contains examples on how to configure the control. If you have any specific questions you can share them in this thread and I will try to answer them.

    Regards,
    Angel Petrov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Patrick
    Patrick avatar
    2 posts
    Member since:
    Feb 2012

    Posted 28 Mar in reply to Angel Petrov Link to this post

    My issue is Gridview control displays data in a row/column record layout

    Student ID Assignment ID Grade
    1                Assignment  1   78
    1                Assignment  2   90

    Id like to display and edit data using control as follows:

    Student ID     Assignment 1     Assignment 2
    1                         78                        90

    Any advice?

  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1794 posts

    Posted 31 Mar Link to this post

    Hi Patrick,

    For achieving the desired result you need to include the assignment values per student when you bind the students to the grid. You will also have to add all Assignments as columns in the grid:
    <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource">
    </telerik:RadGrid>

    And the dummy data:
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {       
        DataTable table = new DataTable();
        table.Columns.Add("ID", typeof(int));
        table.Columns.Add("Assignment1", typeof(int));
        table.Columns.Add("Assignment2", typeof(int));
        table.Columns.Add("Assignment3", typeof(int));
     
        table.Rows.Add(1, 78, 62, 20);
        table.Rows.Add(1, null, 52, null);
        table.Rows.Add(1, 55, null, null);
     
        (sender as RadGrid).DataSource = table;
    }

    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  6. Patrick
    Patrick avatar
    2 posts
    Member since:
    Feb 2012

    Posted 31 Mar in reply to Konstantin Dikov Link to this post

    This seems like the step in the right direction so I'm going to try this out. Just one question. I see that the grid is binding to the needdatasource created in code behind and each assignment score is hard coded. The values are dynamic and stored in a day able with fields Student ID, Assignment ID, Score. Is there anyway to reflect the actual values from the Score field in the needdatasource code without hard typing the values in code behind because the would need to be updated and save changes to that database tablevia the grid interface. Wondering if you had any insight on this?
  7. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1794 posts

    Posted 05 Apr Link to this post

    Hi Patrick,

    The RadGrid will display the data that is provided to its DataSource and it could not be used for changing that data per custom requirements. If you need to display all assignments per student on a single row you need to create the appropriate data before binding it to the grid. As for the updates afterwords, since automatic CRUD operations will not be an option, you will have to manually update each record, based on the student ID and the assignment ID:
    Another thing that you could try is to bind the records with the StudentID, AssignmentID and the Score fields directly to the grid and group by the StudentID field:

    Best Regards,
    Konstantin Dikov
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017