Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

ASPxGridView - How to specify the CommandButtons’ and Custom CommandButtons’ properties based on any custom criteria

$
0
0

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

Added By: Jean-Luc Praz at: 11/17/2014 6:24:59 AM    

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.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>