Reputation: 584
I have a Telerik ListView that contains checkBox items.
So, I want in a button to Check all items and in another button to uncheck all the items in this radListView.
How can i do that? Thanks in advance.
Upvotes: 0
Views: 2173
Reputation: 584
Here is the solution... ToggleState.ON to check all and ToggleState.Off to Uncheck all.
for (int item = 0; item < AllowAccess_ListView.Items.Count; item++)
{
AllowAccess_ListView.Items[item].CheckState = Telerik.WinControls.Enumerations.ToggleState.On;
}
Upvotes: 1
Reputation: 91
If you add a class to them you can write a simple jQuery/JS for it.
ex: If you add the class "foo" to your items you could use something like this,
Html-
<button id="checkAll">bla</button>
<button id="unCheckAll">bla</button>
-jQuery
Check:
$('#checkAll').click(function () {
$('.foo').each(function () {
$(this).prop('checked', true);
});
});
Uncheck:
$('#unCheckAll').click(function () {
$('.foo').each(function () {
$(this).prop('checked', false);
});
});
Upvotes: 0