# Form designer: Read-only for a GridView column?

**URL:** <https://discuss.workflowgen.com/t/form-designer-read-only-for-a-gridview-column/238>\
**Category:** Form Designer\
**Created:** [July 19, 2013, 5:14am UTC](https://discuss.workflowgen.com/t/form-designer-read-only-for-a-gridview-column/238 "2013-07-19T05:14:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [July 19, 2013, 5:14am UTC](https://discuss.workflowgen.com/t/form-designer-read-only-for-a-gridview-column/238/1 "2013-07-19T05:14:51Z")

</div>

Setting a GridView column to read-only is not possible via the Form designer or using action parameter, but you can do this using code.

This sample code (in the form designers ASP.NET editor) will sets the TextBox of the second column (`Quantity => Index 1`) to read-only using the HTML `readonly` attribute.

```auto
protected void Page_PreRenderComplete(object sender, EventArgs e)  
{  
 base.Page_PreRenderComplete(sender, e);

((TextBox)this.EXPENSES_GRIDVIEW.Rows[this.EXPENSES_GRIDVIEW.EditIndex]  
.Cells[1].Controls[0]).Attributes["readonly"] = "readonly";

}

```
