ButtonColumn 构造函数

定义

初始化 ButtonColumn 类的新实例。

public:
 ButtonColumn();
public ButtonColumn ();
Public Sub New ()

示例

下面的代码示例演示如何创建和初始化类的新实例 ButtonColumn 并将其添加到 Columns 集合中。

private void Page_Init(Object sender, EventArgs e)
{

   // Create dynamic column to add to Columns collection.
   ButtonColumn AddColumn = new ButtonColumn();
   AddColumn.HeaderText="Add Item";
   AddColumn.Text="Add";
   AddColumn.CommandName="Add";
   AddColumn.ButtonType = ButtonColumnType.PushButton;

   // Add column to Columns collection.
   ItemsGrid.Columns.AddAt(2, AddColumn);
}
Private Sub Page_Init(sender As Object, e As EventArgs)
    
    ' Create dynamic column to add to Columns collection.
    Dim AddColumn As New ButtonColumn()
    AddColumn.HeaderText = "Add Item"
    AddColumn.Text = "Add"
    AddColumn.CommandName = "Add"
    AddColumn.ButtonType = ButtonColumnType.PushButton

    
    ' Add column to Columns collection.
    ItemsGrid.Columns.AddAt(2, AddColumn)
End Sub

注解

ButtonColumn使用构造函数创建和初始化类的新实例ButtonColumn

适用于

另请参阅