# Force save rows in a gridview

**URL:** <https://discuss.workflowgen.com/t/force-save-rows-in-a-gridview/1899>\
**Category:** General WorkflowGen Discussion\
**Created:** [July 19, 2021, 12:14am UTC](https://discuss.workflowgen.com/t/force-save-rows-in-a-gridview/1899 "2021-07-19T00:14:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcarruth](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@dcarruth](https://discuss.workflowgen.com/u/dcarruth)\
**Post date:** [July 19, 2021, 12:14am UTC](https://discuss.workflowgen.com/t/force-save-rows-in-a-gridview/1899/1 "2021-07-19T00:14:45Z")

</div>

Hi,  
We have a few forms that use a gridview to collect data. Every once in a while a form gets submitted with an empty gridview.  
It seems that customers are able to submit the form when the gridview row is still in edit mode. Is there a way to either force save the gridview row when the form is submitted, or at least prevent the form from being submitted?  
Regards,  
Dave

---

<div class="post-metadata">

**Author:** ![eddy.daouk](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/eddy.daouk/32/672_2.png) [@eddy.daouk](https://discuss.workflowgen.com/u/eddy.daouk)\
**Post date:** [July 19, 2021, 2:12pm UTC](https://discuss.workflowgen.com/t/force-save-rows-in-a-gridview/1899/2 "2021-07-19T14:12:26Z")

</div>

Hi,

In the Form designer’s Behaviour feature, you can set the gridview as required. This will make sure the gridview contains at least one row before submitting.

Eddy.

---

<div class="post-metadata">

**Author:** ![dcarruth](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@dcarruth](https://discuss.workflowgen.com/u/dcarruth)\
**Post date:** [July 19, 2021, 11:27pm UTC](https://discuss.workflowgen.com/t/force-save-rows-in-a-gridview/1899/3 "2021-07-19T23:27:56Z")

</div>

Hi Eddy,  
We do that already, but it doesn’t help in the case when they are adding more than one row, and they don’t save the last row.  
There needs to be a way to check that the gridview has been saved before submitting the form.

---

<div class="post-metadata">

**Author:** ![dcarruth](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@dcarruth](https://discuss.workflowgen.com/u/dcarruth)\
**Post date:** [July 19, 2021, 11:30pm UTC](https://discuss.workflowgen.com/t/force-save-rows-in-a-gridview/1899/4 "2021-07-19T23:30:22Z")

</div>

I should also add, that on another of our forms, the gridview is optional. But when it is used, we still need to make sure that the user doesn’t submit when the gridview is in edit mode.

---

<div class="post-metadata">

**Author:** ![eddy.daouk](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/eddy.daouk/32/672_2.png) [@eddy.daouk](https://discuss.workflowgen.com/u/eddy.daouk)\
**Post date:** [July 27, 2021, 1:46pm UTC](https://discuss.workflowgen.com/t/force-save-rows-in-a-gridview/1899/5 "2021-07-27T13:46:59Z")

</div>

Hi @dcarruth,

Unfortunately, that’s how a regular [ASP.NET](http://ASP.NET) GridView works.  
The user needs to click on the Update button so that it triggers a postback and the info is saved in the backend.

You can always find a way to make it work in code behind but it will be complex:

- You have to make sure you’re not saving an empty row
- You have to make sure the data is valid before saving (for example putting text in a number field)
- If you are using any calculations in the footer, you’ll have to also update the footer. (Sum of all rows)

My recommendation is to train the employees to be careful when adding rows to the GridView and change the process to allow the request to be sent back to the user if the row was missing.

Eddy.
