grid creation plus save to database