0

I am doing some project for college in Blazor(.net wasm) and have some page that should implement master-detail view of students. For table look and pagination I used BlazorGrid and it was great but now am stuck because i cannot insert new row in table when name of student is clicked. Does anyone have idea how to do this or some other way of doing pagination in Blazor.

Link on BlazorGrid git https://github.com/AnkitSharma-007/BlazorGrid

and this is pic of my screen, after clicked on name i want to show some more details about student but the best i could do now is to show it right to table (hello, aaaooooo). What i would like is that hello, aaaaoooo is under the row after I clicked name of student screen of my app

mitotomi
  • 102
  • 9

1 Answers1

1
  1. To add a new student you can place a button control Create Student right above the Student Grid. When the use click this button, a new view is displayed with controls to collect student details. When the Save button is clicked the new student record should be added to the data store and a navigation to the Student Grid performed, displaying all students, including the added one.
  2. To display a student's details below the student record you may do the following: A. Create a StudentDetails Component for displaying the student's details. This Component can be a Templated Component, similar in structure to the StudentGrid. And it should be placed at the end of the GridRow. Now, when the user clicks a student name, the StudentDetails Component for the selected student should be displayed beneath the Student Row. There are many ways to implement this. For example, to create a Parameter property in the StudentDetails, pass the Student ID of the selected student, retrieve the student's details and display them, etc., etc.

Note: There are plenty of ways to implement your requirements. Some are sophisticated other are less. In my opinion you should create a State class whose responsibilities should be retrieving and handling data, as well as events and event notifications, and Components whose main objective should be confined to presentation (UI).

Hope this helps...

enet
  • 41,195
  • 5
  • 76
  • 113