# Gridview update button

**URL:** <https://discuss.workflowgen.com/t/gridview-update-button/2313>\
**Category:** General WorkflowGen Discussion\
**Created:** [August 21, 2025, 2:42am UTC](https://discuss.workflowgen.com/t/gridview-update-button/2313 "2025-08-21T02:42:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![crturner](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@crturner](https://discuss.workflowgen.com/u/crturner)\
**Post date:** [August 21, 2025, 2:42am UTC](https://discuss.workflowgen.com/t/gridview-update-button/2313/1 "2025-08-21T02:42:14Z")

</div>

I have reviewed the discussion forum and attempted the solutions, however the update button fails to hide from my form. I have used the gridview form designer properties to remove the edit and delete buttons, but that results in my gridview being completely removed from the form during runtime. I have found previous discssions on the topic where code was provided inb order to hide buttons but that only seems to work after the gridview has been updated manually. I am populating and updating the gridview programmatically so there is no reason I need an update button on the form at all.

---

<div class="post-metadata">

**Author:** ![nvarlet](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@nvarlet](https://discuss.workflowgen.com/u/nvarlet)\
**Post date:** [August 27, 2025, 7:46am UTC](https://discuss.workflowgen.com/t/gridview-update-button/2313/2 "2025-08-27T07:46:27Z")

</div>

Hello.

Here’s what I’ve done (and it’s working).

The grid view is “standard” and not in read only mode :

 ![{8D9DAECF-D4BB-4BA9-B41A-F57542904216}](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/2761a2589da4d241d20e6e8aa9e627952696490c.png)

No specific validation and no personalized parameters.

Here’s the code I’ve done :

```
// Init pour la bonne gestion des grilles
protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    init_gridviews();
}     

// Init pour la bonne gestion des grilles ALV
protected override void OnPreLoad(EventArgs e)
{
    base.OnPreLoad(e);
    init_gridviews();
}     

// Gestion event des grilles
private void init_gridviews()
{   
    //Delete edit button from gridview
    NAME_OF_GRIDVIEW.RowDataBound += new GridViewRowEventHandler(Gridview_RowDataBound);

}

//Button mgt on grid view
private void Gridview_RowDataBound(object sender, GridViewRowEventArgs e)
{
    // You need to identify the column number of the buttons
    // In this example, my gridview has 3 columns. Buttons are in column number 4 (so index = 3)
    int index = 3;

    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        foreach (Control c in e.Row.Cells[index].Controls)
        {
            if (c is Button)
            {
                Button b = (Button)c;
                if (b.Text == "Edit" || b.Text == "Update" || b.Text == "Delete")
                {
                    b.Visible = false;
                }
            }
        }
    }
}          

```

I hope it helps.

Best regards
