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

RadGrid Checkbox column and paging

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prashant
Top achievements
Rank 1
Prashant asked on 05 Dec 2012, 01:44 PM
Hi,

I am using a rad grid which is having a CheckBox column and with multiselection. Paging is enabled for the grid. If user selects one or more row in the grid and clicks on next or prev page button in the pager. A confirmation message should be displayed to user. If user clicks on "OK" in the confirmation message, i would like to perform operation(delete) and page should be changed (user should be redirected to next page), if he clicks on cancel, selection should be cleared and page should be changed.

Can you please help me with this scenario? A code sample will be of great help.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 10 Dec 2012, 09:39 AM
Hello Prashant,

Your scenario could be implemented using the following steps:
  1. Intercept the client-side OnCommand event and check whether the commandName is Page
  2. Iterate through the items in the grid and see if there are any checked, if this is the case display a RadConfirm dialog.
  3. If the Ok button is clicked fire a DeleteSelected command with the index of the page to which you want to navigate(how to fire a command).
  4. In the OnItemCommand(server-side) make the appropriate changes in the database and rebind the grid.
Note that if you delete records from the grid and page you would not get the exact collection of records to which you wanted to navigate previously because the indexes of the records would have been changed.

Kind regards,
Angel Petrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Prashant
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or