how to save data in arraylist of an class and then how to show in datagrid using functions