Q: In Search Grid Control, I want to write “double click” event but I could not find this event in Search Grid properties. Could you show me how to implement this event?
Double Click event in Search Grid
Double click event is implemented in the Search Grid (or simple Grid) using activationAction event handler.
The activationAction sets the action to be launched when a cell in a row is double clicked. This action is executed if and only if the cell is not editable and the corresponding column control of the cell is not an action control (hyperlink or button).
Step by Step Example
The following example illustrates this use:
Adding A Grid
Let’s add a grid called grdRelCustomers:
Adding the Activation Action
Now we add a new Submit action named RelCustomerSubmitAction to perform the search in the database. This action would query the database and return the data to be displayed in the grid (in fact – the data will populated relatedCustomersTDM which is used as the Grid’s displayTDM).
Define Activation Action actionStart Event
We now define the actionStart Event for the RelCustomerSubmitAction to handle the double click event:
Code actionStart Event Handler
The following event handler should respond to a double click performed on the Grid:
Define the Grid’s activationAction
Back to the Grid properties, we now define the activationAction property as RelCustomerSubmitAction
The Grid activationEvent is now related to its event handler.
Now let’s test it at runtime: