TButtonColumn contains a user-defined command button, such as Add or Remove, that corresponds with each row in the column.
The caption of the buttons in the column is determined by Text and DataTextField properties. If both are present, the latter takes precedence. The DataTextField refers to the name of the field in datasource whose value will be used as the button caption. If DataTextFormatString is not empty, the value will be formatted before rendering.
The buttons in the column can be set to display as hyperlinks or push buttons by setting the ButtonType property. The CommandName will assign its value to all button's CommandName property. The datagrid will capture the command event where you can write event handlers based on different command names.
Note, the command buttons created in the column will not cause validation. To enable validation, please use TTemplateColumn instead.
Namespace: System.Web.UI.WebControls
Properties
Text, string, kept in viewstate
Gets or sets the text of the button
EncodeText, boolean, default=true, kept in viewstate
Gets or sets the value indicating whether the button text should be HTML-encoded when rendering.
DataTextField, string, kept in viewstate
Gets or sets the name of the data field associated with the text of the button
DataTextFormatString, string, kept in viewstate
Gets or sets the string that is used to format the DataTextField value for the button text.
The format string is used as the first argument to the sprintf() function.
ButtonType, string (LinkButton,PushButton), default=LinkButton, kept in viewstate
Gets or sets the type of button to be displayed.
CommandName, string, kept in viewstate
Gets or sets the command name associated with command button.