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

How to call an Action method via a custom button and pass a row's key as a parameter

$
0
0

- Define a custom button via the GridViewSettings.CommandColumn.CustomButtons collection;
- Customize the client-side CustomButtonClick event handler via the GridViewSettings.ClientSideEvents.CustomButtonClick property: pass the destination Url/Address (generated via the Url.Action helper method) as a parameter;
- Handle the client-side ASPxClientGridView.CustomButtonClick event;
- Retrieve the clicked row's keyValue via the client-side ASPxClientGridView.GetRowKey method. Use the EventArgs e.visibleIndex property as a parameter;
- Add the retrieved keyValue parameter to the specified destination Url;
- Navigate to the specified Url by changing the window.location.href property;
- Retrieve the passed keyValue via an argument of the invoked Action's parameter.

Question Comments

Added By: Sorin Sandu at: 4/28/2015 1:42:07 AM    

On me s parameter is undefined.
What I am doing wrong ?

Added By: Vasily (DevExpress Support) at: 4/28/2015 4:24:43 AM    

Hi Sorin,

To process your recent post more efficiently, I created a separate ticket on your behalf: T235581: Parameter is undefined when using a solution provided in the E4827 code example. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



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