This is a migrated thread and some comments may be shown as answers.

set_cancel in OnRowClick event

4 Answers 184 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vandara Peou
Top achievements
Rank 1
Vandara Peou asked on 16 Dec 2008, 05:17 PM
Hi,

I'm trying to use the set_cancel() function in the client side OnRowClick event and it said the function does no exist.

The help file says "Can Be Cancelled: Yes, meaningful when setting ClientSettings -> EnablePostBackOnRowClick to true" and even has sample code demonstrating it. I do have enablepostbackonrowclick set to true but the method cannot be found.

eventArgs is returning an object and I can successfully get the data grid item from it.

Any ideas?

Thanks,
Vandara Peou

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 16 Dec 2008, 06:29 PM
Hello Vandara,

I can't find the mentioned statement in our documentation. The actual link is shown below:
OnRowClick

This event is fired when a row is clicked.

Fired by

RadGridTable

Arguments

gridDataItem - tablerow instance

domEvent - dom event

Can be canceled

No

Examples

ascx/aspx

<ClientEvents OnRowClick="RowClick" ...

JavaScript

  <script>

function RowClick(sender, eventArgs)

 { 

    alert("Click on row instance: " + eventArgs.get_itemIndexHierarchical());
 }

</script>


Please let me know if I missed something.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Vandara Peou
Top achievements
Rank 1
answered on 16 Dec 2008, 06:36 PM
I'm looking at the help file for ASP.NET AJAX Q3 2008. It has a revision date of 11/05/2008. I see that the link you sent me has a revision of 12/03/2008 so I'm guessing the functionality was just taken out in one of the revisions and not documented in the list of changes?

The exact entry is located below:

Telerik.Web.UI.GridDataItemEventArgs OnRowClick Property

note

To get or set property values for client API properties, you must call property accessor methods that are named with the get_ and set_ prefixes. For example, to get or set a value for a property such as cancel, you call the get_cancel or set_cancel

This event is fired when a row is clicked.

Fired by

RadGridTable

Arguments

gridDataItem - tablerow instance

domEvent - dom event

Can be canceled

Yes, meaningful when setting ClientSettings -> EnablePostBackOnRowClick to true

Examples

ascx/aspx

<ClientEvents OnRowClick="RowClick" ...

JavaScript

  <script>

function RowClick(sender, eventArgs)

 { 

    alert("Click on row instance: " + eventArgs.get_itemIndexHierarchical());
    eventArgs.set_cancel(true);

 }

</script>

 

note

get_gridDataItem() is not directly available on the client unless OnRowCreating/OnRowCreated events are hooked up. This is done for optimization purpose. If you need the rowIndex, you can use eventArgs.get_itemIndexHierarchical()

 

0
Daniel
Telerik team
answered on 19 Dec 2008, 05:33 PM
Hello Vandara,

I noticed the mentioned problem. We need some time to investigate the reason for this discrepancy. You will be notified when we have some information about this matter.

Thank you for your cooperation.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Daniel
Telerik team
answered on 13 Jan 2009, 01:40 PM
Hello Vandara,

RowClick client-side event cannot be canceled in the current version of RadControls for ASP.NET AJAX. We already fixed the depicted discrepancy in our documentation.

Please excuse us for the caused inconvenience. As a sign of gratitude for your cooperation I added Telerik points to your account.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Vandara Peou
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Vandara Peou
Top achievements
Rank 1
Share this question
or