13 Answers, 1 is accepted
Refer the following forum link which discusses how to select all the rows in grid regardless of paging. Hope it will shed some light in implementing the functionality.
Checkbox Select - Multiple Pages
-Shinu.
RadGrid have in memory only current page items. If you need all items you should disable paging. However if you have a lot of records to be displayed there will be performance penalties.
Regards,
Nikolay
the Telerik team
I just checked out the project pagingsortingwithclientsideselecting-ajax.zip from this Code Library referenced from this page and found a strange behaviour: the 'select all' checkbox gets selected when returning to page 2.
Steps to reproduce the issue:
1) Start the project
2) Select row 1 on page 1
3) Select row 2 on page 2
4) Navigate to page 1 and back to page 2
5) The 'select all' checkbox is selected!!!
Can someone confirm this? Or even better: is there a workaround for this?
Regards,
Tonino.
The code library is about to be modified with correct code. For your convenience I am attaching how this scenario should be properly implemented.
Greetings,
Nikolay
the Telerik team
Hi Nikolay
Thanks for your reply! Now it works like a charm!
Another question: is it possible to have this feature (selecting items on more than one page client-side) [feature A] and enable selection of rows just by clicking the checkbox (no selection when row is clicked elsewhere) [feature B].
The problem that I encountered is that the function CancelNonInputSelect() allows just selection generated by clicking a checkbox. But this interferes with set_selected for the other feature [feature A] ...
Here some details of the implementation of feature B:
<ClientEvents OnRowSelecting="CancelNonInputSelect" OnRowDeselecting="CancelNonInputSelect" />
//cancel all select/deselect operation triggered by non-checkbox row clicks
function
CancelNonInputSelect(sender, args) {
var
e = args.get_domEvent();
//IE - srcElement, Others - target
var
targetElement = e.srcElement || e.target;
//this condition is needed if multi row selection is enabled for the grid
if
(
typeof
(targetElement) !=
"undefined"
) {
//is the clicked element an input checkbox? <input type="checkbox"...>
if
(targetElement.tagName.toLowerCase() !=
"input"
&&
(!targetElement.type || targetElement.type.toLowerCase() !=
"checkbox"
)) {
args.set_cancel(
true
);
return
;
}
}
else
{
args.set_cancel(
true
);
return
;
}
}
Regards,
Tonino.
You can use
<Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true"></Selecting>
to enable selection only when GridClientSelectColumn is clicked.
Greetings,
Nikolay
the Telerik team
Thanks for the hint! I wasn't aware of this new setting. That makes it easy!
I would be helpful to refere to the new feature on this page:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/clientsideselectcolumn-disallow-other-selection.aspx
Regards,
Tonino.
Thank you for pointing this to us.
We will update the code library shortly.
Best wishes,
Iana
the Telerik team
best regards,
Luis
For Each item As GridDataItem In Radgrid1.MasterTableView.Items
Next
In fact this is not possible, because the grid is creating only the items for the current page. So the items for the rest of the pages are not available at all.
Best wishes,
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.
hi,
Kindly help me how to have a select all option that selects only those entries that are in that particular page alone not the entire dataset.Help to solve the issue
The mentioned functionality is the default multi-selection provided by RadGrid:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/selecting/row-selection/defaultcs.aspx
Do you have something else in mind?
Regards,
Eyup
Telerik