Reputation: 1269
I know the way that initialize datagrid with data. But I want to be able to add entry at runtime with add button and a form.
Upvotes: 0
Views: 79
Reputation: 2023
You have to create a List of the objects which your DataGrid should contain. Also you can append an object to the list, if you want to add a new entry.The objects should be of the same type as your DataGrid,you are defining it when you create or extend the Datagrid (between the < > ) . Then call the .setRowData(list)
and the datagrid will be filled up. If you want to add a new list, clear the datagrid before and call .setRowCount(0)
.
Upvotes: 1