Replies: 3 comments
-
|
Beta Was this translation helpful? Give feedback.
-
In my project, i use List like porkopek says.
This works for me. But if you add new row outside of the page like dialogs, new row doesn't visible automatically. You need to call StateHasChanged() method on parent component. You can add a refresh button on MudTable header, and the user can easily refresh component. |
Beta Was this translation helpful? Give feedback.
-
Thank you both. It turns out I was just doing something stupid. Instead of private List students = new List(); I had private List students; So, I was getting Null errors when I tried to show the table. Thus, I went back to the sample code and declared my source as IEnumerable (which doesn't have Add). By properly declaring the List and creating NEW, I could use List as the source and thus Add rows. |
Beta Was this translation helpful? Give feedback.
-
MUDTABLE Items
The API indicates that Items must be IEnumerable.
It appears that IEnumerable lists don't have an Add property.
So, how can we programmatically add a row to a MudTable?
Right now, I have an "Add" button, which displays a MudDialog that has a MudForm in it. When the user fills out that form and submits, I currently add a row to the SQL Server table.
I need to also add the row to the MudTable. But, it seems inefficient to re-run the stored procedure and refresh the entire table.
Beta Was this translation helpful? Give feedback.
All reactions