A column type for the DataGrid control that contains a user-defined command button, such as Add or Remove, that corresponds with each row in the column.
For a list of all members of this type, see ButtonColumn Members.
[Visual Basic] Public Class ButtonColumn Inherits DataGridColumn [C#] public class ButtonColumn : DataGridColumn [C++] public __gc class ButtonColumn : public DataGridColumn [JScript] public class ButtonColumn extends DataGridColumn
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Use the ButtonColumn column type in a DataGrid control to create a command button that corresponds with each row in the DataGrid control. Specify the caption displayed in the command buttons by setting the Text property.
Note If you set the Text property, all command buttons in the column share the same caption.
Alternatively, you can bind the ButtonColumn column to a field in a data source. This allows you to display different captions for the command buttons in the column. The values in the specified field are used for the text caption. Set the DataTextField property to bind the column to a field in a data source.
You can format the captions displayed in the command buttons by setting the DataTextField property with a formatting string.
Clicking on the command buttons in the column raises the ItemCommand event. You can programmatically control the action performed when the command button is clicked by providing an event handler for the ItemCommand event.
Note Unlike regular button controls, validation in not performed when the buttons in the ButtonColumn are clicked. To create a column with buttons that perform validation when clicked, add a button control, such as Button or LinkButton, to a TemplateColumn.
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
Assembly: System.Web (in System.Web.dll)