The example demonstrates how to specify the CommandButtons and Custom CommandButtons properties by handling the CommandButtonInitialize and CustomButtonInitialize events. The DataRows' VisibleIndex property and criteria set based on field values are used to determine the buttons' visibility.
Question Comments
Added By: Hans Leonhardt at: 11/16/2013 9:27:49 AM
Just as an addition:
If you're Using an Entity e.g. an EntityDatasource this fails. This will work, e.g.
Private Function DeleteButtonVisibleCriteria(ByVal grid As ASPxGridView, ByVal visibleIndex As Integer) As Boolean
Dim row As NameOfYOurEntity = ASPxGridView1.GetRow(visibleIndex)
' e.g: The Entity has a boolean Property named "isAdmin"
Return row.isAdmin
End Function
Is there a way to find out if a row is the first or last row in a Grid ? I need to hide a button based on that criteria ?
Added By: Alessandro (DevExpress Support) at: 11/17/2014 7:47:58 AM Hi,I will create a separate ticket on your behalf to keep this web page simple: ASPxGridView - E3028 - Check row location. Thank you for your time and cooperation in advance.