I have a radGridView with a checkbox column. When a button is clicked I want to automatically check all of the checkboxes in that column of the RadGridView. I am using the following example code, the problem is that this code only checks VIEWABLE checkboxes, so if I scroll down in the grid the remaining checkboxes are unchecked. I am trying to find a way to check all checkboxes in that column (not just the viewable ones). Thanks in advance for any help!
<
telerik:GridViewColumn
Header
=
"Voucher"
>
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
CheckBox
IsChecked
=
"{Binding VoucherRequested}"
Width
=
"75"
/>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewColumn
>
IList<
GridViewRow
> rows = RadGridView_TrusteeLedgers.ChildrenOfType<
GridViewRow
>();
int checkboxCount = 0;
foreach (GridViewRow row in rows)
{
if (!(row is GridViewNewRow) && !(row is GridViewHeaderRow))
{
Ledger_Get6855TTPendingLedgers_Result result = row.DataContext as Ledger_Get6855TTPendingLedgers_Result;
CheckBox checkBox = row.Cells[9].ChildrenOfType<
CheckBox
>().FirstOrDefault();
if (checkBox != null)
{
if (CheckBox_VoucherListedItems.IsChecked == true)
{
checkBox.IsChecked = true;
}
else
{
checkBox.IsChecked = false;
}
checkboxCount++;
}
}
}