GridViewCommandColumnCustomButton.Visibility Property
Gets or sets a value that specifies in which rows the custom button is displayed.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
Declaration
[DefaultValue(GridViewCustomButtonVisibility.BrowsableRow)]
public GridViewCustomButtonVisibility Visibility { get; set; }
Property Value
Type | Default | Description |
---|---|---|
GridViewCustomButtonVisibility | BrowsableRow | A GridViewCustomButtonVisibility enumeration value that specifies in which rows the custom button is displayed. |
Available values:
Name | Description |
---|---|
FilterRow | A custom button is displayed within the Filter Row. |
AllDataRows | A custom button is displayed within all data rows. |
BrowsableRow | A custom button is displayed within data rows whose values are not edited. |
EditableRow | A custom button is displayed within a data row currently being edited. |
Invisible | A custom button is hidden. |
Remarks
# [C#](#tab/tabid-csharp)
```csharp
using DevExpress.Web.ASPxGridView;
protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
// Creates and initializes a command column.
GridViewCommandColumn commandCol = new GridViewCommandColumn("Action");
commandCol.Name = "Action";
ASPxGridView1.Columns.Add(commandCol);
}
// Creates a custom command button.
(ASPxGridView1.Columns["Action"] as
GridViewCommandColumn).CustomButtons.Add(CreateCustomButton());
}
GridViewCommandColumnCustomButton CreateCustomButton() {
GridViewCommandColumnCustomButton customBtn = new GridViewCommandColumnCustomButton();
customBtn.ID = "action1";
customBtn.Text = "Action1";
customBtn.Visibility = GridViewCustomButtonVisibility.BrowsableRow;
return customBtn;
}
// Occurs after a command button has been clicked.
protected void ASPxGridView1_CustomButtonCallback(object sender,
ASPxGridViewCustomButtonCallbackEventArgs e) {
if (e.ButtonID == "action1") {
// ...
}
}
```
***
See Also