This is a migrated thread and some comments may be shown as answers.

Gradebook Grid Display & Editing Question

5 Answers 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aiden James-Anthony
Top achievements
Rank 1
Aiden James-Anthony asked on 28 Sep 2015, 06:03 PM

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

 

 

5 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 01 Oct 2015, 12:09 PM
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
0
Patrick
Top achievements
Rank 1
answered on 28 Mar 2016, 07:50 PM

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?

0
Konstantin Dikov
Telerik team
answered on 31 Mar 2016, 11:11 AM
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.
0
Patrick
Top achievements
Rank 1
answered on 31 Mar 2016, 03:21 PM
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?
0
Konstantin Dikov
Telerik team
answered on 05 Apr 2016, 08:18 AM
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.
Tags
Grid
Asked by
Aiden James-Anthony
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Patrick
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or