Improved Documentation: Explore The ASPx Client-Side Events

Yesterday, someone asked if it’s possible to have the ASPxGridView go into EditMode as soon as a row is clicked.

The first thought was to simply ‘Enable Editing’ from the Smart Tag menu of the ASPxGridView. This will add another column to the grid with command links labeled Edit:

image

 

However, they didn’t want to use any command links. Instead, for their particular UI, it was necessary to edit the row as soon as it was clicked.

So a Client-Side event would be necessary here. Which one?

The great news about the new ASPx Suites is the improved documentation. Now you can easily find methods and properties for the Client-Side objects.

To find any of the Client-Side events, simply insert the word Client after ASPx in the ASPxObjectName. Therefore, to find the Client-Side events for ASPxGridView simply search the help for ASPxClientGridView.

ASPxGridView = ASPxClientGridView

ASPxComboBox = ASPxClientCombobox

ASPxMenu = ASPxClientMenu

…  You get the idea.

Using this technique, it was easy to find the StartEditRow() method for the Client-Side ASPxCLIENTGridView. Now, to simply attach it to one of the Client-Side events which are easily accessible from the ASPxGridView smart tag:

image

This will give you access to Client-Side Events Editor. Find the RowClick method and add the following line of code to put the ASPxGridView into EditMode as soon as it clicked on a row:

ASPxGridView1.StartEditRow(e.visibleIndex);

The Client-Side methods already contain the function skeleton and you simply need to add your code. In this instance, the StartEditRow is called with the current visibleindex (from the e/args parameter) that was clicked:

image

Now every time the row is clicked, it will enter into EditMode.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s