Back to Devexpress

ASPxGridCommandButtonEventArgs.VisibleIndex Property

aspnet-devexpress-dot-web-dot-aspxgridcommandbuttoneventargs.md

latest2.6 KB
Original Source

ASPxGridCommandButtonEventArgs.VisibleIndex Property

Gets the visible index of a data item (row, card or record) which contains the processed command button.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public int VisibleIndex { get; }
vb
Public ReadOnly Property VisibleIndex As Integer

Property Value

TypeDescription
Int32

An integer value that identifies the data item by its visible index.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the VisibleIndex property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

aspxgridview-customize-command-buttons-in-rows/CS/HideCommandButtons/Default.aspx.cs#L29

csharp
protected void ASPxGridView1_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e) {
    bool isOddRow = e.VisibleIndex % 2 == 0;
    if(isOddRow) { // some condition

aspxgridview-customize-command-buttons-in-rows/VB/HideCommandButtons/Default.aspx.vb#L29

vb
Protected Sub ASPxGridView1_CommandButtonInitialize(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridViewCommandButtonEventArgs)
    Dim isOddRow As Boolean = e.VisibleIndex Mod 2 = 0
    If isOddRow Then ' some condition

See Also

ASPxGridCommandButtonEventArgs Class

ASPxGridCommandButtonEventArgs Members

DevExpress.Web Namespace