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

Disable RowClick on ParentRow (Self-Referencing Hierarchy grid)

4 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 26 Oct 2009, 04:50 PM
Hi,

I have a Self-referencing hierarchy grid (I am using code in this link http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/selfreferencing/defaultcs.aspx),

I want to to call radGrid ItemCommand event for "RowClick" only when childrows clicked.. I am using client event (below) for that,

RadGrid1.ClientSettings.ClientEvents.OnRowSelecting = "RowSelecting"
    function RowSelecting(sender, eventArgs) {
        var parentRow = eventArgs.get_tableView().get_parentRow();
        if (parentRow == null) {
            eventArgs.set_cancel(true);
        } 
    }

When I click the parent row, its calling the javascript function and cancelling the event..BUT ItemCommand event is still executing..

How to avoid this?

Thanks

4 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 29 Oct 2009, 05:47 PM
Hello Suneel,

I have followed your scenario and prepared a sample project for you in which neither the OnCommand client-side event, nor the ItemCommand server-side events are fired.
Please take a look at it and tell me what are the differences in your case.

Best wishes,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sunny
Top achievements
Rank 1
answered on 29 Oct 2009, 06:52 PM
Hi,

Sorry I also have in definition

            RadGrid1.ClientSettings.ClientEvents.OnRowSelecting = "RowSelecting"
            RadGrid1.ClientSettings.EnablePostBackOnRowClick = True

and with these I want to fire ItemCommand only when child rows clicked.

Thanks
0
Sunny
Top achievements
Rank 1
answered on 03 Nov 2009, 02:59 PM
Any feedback on this ?
0
Mira
Telerik team
answered on 04 Nov 2009, 07:09 AM
Hi Suneel,

To achieve the desired by you functionality, you can try canceling the OnRowClick client event when a row from the MasterTableView of the grid is clicked.

All the best,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Sunny
Top achievements
Rank 1
Answers by
Mira
Telerik team
Sunny
Top achievements
Rank 1
Share this question
or