I have ASPxGridView to view a list of records. From the view, I create a delete column and want it to show a delete button whenever the record does have a satisfy condition. The code below:
<dx:GridViewCommandColumn Caption="Delete" VisibleIndex="1" Width="30px"
meta:resourcekey="GridViewCommandColumnResource1">
<DeleteButton Visible="True">
</DeleteButton>
</dx:GridViewCommandColumn>
So I focus on the Visible attribute of DeleteButton. The condition must return a boolean value so it knows when to show and hide the delete button. Below is an example how to implement this:
<DeleteButton Visible='<%# ShowHide(Eval("Active")) %>'>
</DeleteButton>
in VB Code:
Protected Function ShowHide(Active As Boolean) As Boolean
Return Active
End Function
So the function need to return a True value if Active is True, and False value if Active is False. In other words, I do trigger a function in code behind on every record to make it show the delete button if record does have a satisfy condition. But I got an error message in the end:
Parser Error Message: Databinding expressions are only supported on objects that have a DataBinding event. DevExpress.Web.ASPxGridView.GridViewCommandColumnButton does not have a DataBinding event.
I stuck there and don't know other way to do this. Please help me with this.