Blogs

News

Email Subscriptions

Mehul Harry's DevExpress Blog

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.

Published Jul 25 2007, 12:10 PM by Mehul Harry (DevExpress)
Bookmark and Share

Comments

 

Suv said:

if I assign the ID of a ASPxGridView as LogView and I want to access the client side events then how do I do it. Also the client side events dont seem to be firing for the grid u? Can u give me some directions on this.

September 13, 2007 11:12 PM
 

Mehul Harry (DevExpress) said:

SUV,

The forums is a better place to post this question. Take a look at our demos and tutorials. Also take a look at the ClientInstanceName property.

Thanks.

September 14, 2007 1:18 AM
 

The ASPx Blog said:

Looking for help with the ASPxGridView? Here are the top 7 links to a wealth of grid-tastic assistance

October 26, 2007 4:13 AM
 

The ASPx Blog said:

Check out these 4 new screencasts. Three show you how to customize the ASPxperience products and one

March 21, 2008 3:32 AM
 

.Net World said:

Check out these 4 new screencasts. Three show you how to customize the ASPxperience products and one

March 29, 2008 2:15 AM
 

James Foye said:

This tuturial by Mehul is definitely helpful.

www.devexpress.com/.../ASPxperience_Client-Side_API.html

July 13, 2008 9:02 PM
 

nrdn aks said:

function SecileniAl() {

   QueryString = window.location.search.substring(1);

   var Parametreler = QueryString.split('&');

   var Degerler = Parametreler[1].split('=');

   grdSecim.GetRowValues(grdSecim.GetFocusedRowIndex(), Degerler[1].replace(/%3b/g, ";"),OnGetRowValues);

}

function OnGetRowValues(values) {

   DonecekDeger = "OK";

   for (var i = 0; i < values.length; i++) {

       if (values[i] == null)

           DonecekDeger = DonecekDeger + "#-1";

       else

           DonecekDeger = DonecekDeger + "#" + values[i];

   }

}

Mobil Web Project.OnGetRows don't see.

March 3, 2010 4:16 AM
 

Mehul Harry (DevExpress) said:

Nrdn Aks,

Please contact our support team regarding any issues here:

www.devexpress.com/.../CreateIssue.aspx

March 3, 2010 1:53 PM
 

Adrian Rotaru said:

Hi

I need to ask for a password each time a user updates a row data.

Thanks.

November 25, 2011 11:13 AM

About Mehul Harry (DevExpress)

Mehul Harry is an ASP.NET technical evangelist at Developer Express. You can reach him directly at mharry@DevExpress.com. You can also follow him on Twitter: http://twitter.com/mehulharry
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.