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

RadGrid Selecting row by checkbox

3 Answers 234 Views
Grid
This is a migrated thread and some comments may be shown as answers.
john
Top achievements
Rank 1
john asked on 19 Jan 2011, 07:13 PM
Hi,

            Am using RadGrid in my page,having skin for that grid.Skin having client events like RowSelecting,deselcting,RowSelected and Deselected events. Now i want ask the user a java script confirm when ever a user Un check the check box,So i overrided that RowDeselecting event alone in my page.

But the issue is 

    1) whenever i click on that row it is deselecting the records even am preventing RowClick event,i declared RowClick event in skin.
    2) After deselecting the row ,again when i select the row now also it firing RowDeselcting Event.

This issue arises only after overriding the RowDeselecting event.

Please help me to fix this or Suggest me some other solution.

Thanks and regards,
John

3 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 24 Jan 2011, 03:51 PM
Hi john,

The OnRowClick event is not cancelable. If you want to prevent an item's selection, you need to cancel it in the OnRowSelecting event.
Also, when single-row selection is enabled, and you have one row selected, upon selecting another row, the previously selected row is being deselected. And that is why the OnRowDeselecting event is fired.
What you can do to achieve your goal, is to use the GridClientSelectColumn for items selection. Then set the UseSlectColumnOnly property in the Selecting settings to true. Thus the user would be able to select an item only upon checking the select column checkbox but clicking on the item. In this case, you can handle the onclick or onchange event of the checkbox in the select column and ask for confirmation there.

All the best,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
john
Top achievements
Rank 1
answered on 27 Jan 2011, 06:14 AM
Selecting Settings in Not available.
Am using 2009 Release.

And another issue,While loading grid itself am selecting few checkboxes.After that am deselecting a checkbox it is firing Rowdeselecting event.Now againg selecting the checkbox it is firing RowDeselecting event.

Am using RegisterStartUpScript from code behind
Please help me.

0
Iana Tsolova
Telerik team
answered on 31 Jan 2011, 04:35 PM
Hello john,

You can try updating to the latest version of the controls in order to use the UseSelectColumnOnly feature.
Regarding the other issue: Can you share the page full code, so I can try running it locally for further testing?

Greetings,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
john
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
john
Top achievements
Rank 1
Share this question
or