I would like to change the text of an auto-generated column "select"in an ASP.NET control GridView. The text must be changed to a value DataField.
"select"
GridView
DataField
I suspect there is a very logical way to do this, but I do not see it. I can add controls and data through a pre-render event, but is there an easier way?
Use a TemplateField and place buttons or link buttons in it with the corresponding CommandName property: ButtonField.CommandName Property You can set this button text using the DataBinder.Eval method.
The easiest way I've found to do this is to call the DataBind () call just before the gridview control is displayed.
foreach (GridViewRow row in gvAgreementList.Rows) { LinkButton lb = (LinkButton) row.Cells[0].Controls[0]; lb.Text = "Edit"; }
<column> :
<column>
<asp:CommandField ShowSelectButton="True" SelectText="Save" />
AutoGenerateSelectButton="True" Gridview.
AutoGenerateSelectButton="True"
Gridview
, GridView .. GridView, commandfields → Select, SelectText.
commandfields
Select
SelectText
( ShaileshK )
Go to the GridVIew .. tasks at the top of the right GridView button, and then click on editing the columns. In the selected field section, click on the selection field. change the value of the selected text. done.