Unplanned
Last Updated: 28 May 2020 10:06 by n/a
n/a
Created on: 26 May 2020 13:07
Category: GridView
Type: Bug Report
0
RadGridView: HeaderCheckbox check/uncheck checkboxes of the first page only when EnablePaging = true
Now, I have 2 problems:

1. Checking / Unchecking header check box, checks/unchecks checkboxes of current page only.  I need to perform the operation for the whole grid.

2. I have got filters on.  User can select filters on columns.  Once filters are applied, records are displayed according to those filters (other records are hidden).  Now, when checking the header check box, it only selects records that are part of current page.  For example, if I am on first page and apply filter on one column, grid will hide all rows from the first page that do not match the filter and pull records from 2nd and 3rd pages that match the criteria and show on the first page.  But if I select check box in the header, then only records from first page are selected, records that came from 2nd and 3rd page are not selected.

 
4 comments
n/a
Posted on: 28 May 2020 10:06

Thanks Nadya,

It works fine now.

ADMIN
Nadya | Tech Support Engineer
Posted on: 28 May 2020 09:45

Hello Betsy,

ShouldCheckDataRows property is public property, but it is not browsable. Could you please type it instead of choosing it by the intellisense functionality. It was introduced many years ago so it should be accessible with the latest versions only when typing it.

Let me know if you need further assistance.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
n/a
Posted on: 28 May 2020 09:20

Hi Nadya,

 

Thanks for the reply.

I cannot find the "ShouldCheckDataRows" property on the GridViewCheckBoxColumn.

I tried using "Telerik UI for WinForms R1 2019" version and "Telerik UI for WinForms R2 2020" version.

Please refer the attached screenshot.

Kindly let me know which version shall I use?

ADMIN
Nadya | Tech Support Engineer
Posted on: 26 May 2020 14:05

Hello Betsy,

To workaround this please refer to the following code snippet:

Public Class RadForm1
    Public Sub New()
        InitializeComponent()
        Me.RadGridView1.EnableFiltering = True
        Me.RadGridView1.EnablePaging = True
        Me.RadGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill
        Dim checkBoxColumn As GridViewCheckBoxColumn = New GridViewCheckBoxColumn()
        checkBoxColumn.HeaderText = "CheckBoxColumn"
        checkBoxColumn.CheckFilteredRows = False
        checkBoxColumn.EnableHeaderCheckBox = True
        checkBoxColumn.ShouldCheckDataRows = False
        RadGridView1.MasterTemplate.Columns.Insert(0, checkBoxColumn)
        AddHandler Me.RadGridView1.HeaderCellToggleStateChanged, AddressOf Me.RadGridView1_HeaderCellToggleStateChanged
    End Sub

    Private Sub RadGridView1_HeaderCellToggleStateChanged(ByVal sender As Object, ByVal e As GridViewHeaderCellEventArgs)
        Dim dataView As Telerik.WinControls.UI.GridDataView = TryCast(Me.RadGridView1.MasterTemplate.DataView, GridDataView)
        For Each row As GridViewRowInfo In dataView.Indexer.Items
            row.Cells(0).Value = Convert.ToBoolean(e.State)
        Next
    End Sub
End Class

I hope this helps.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Attached Files: