Completed
Last Updated: 13 Nov 2024 12:46 by ADMIN
Release 2024.4.1113 (2024 Q4)
Julian
Created on: 30 Sep 2024 13:32
Category: GridView
Type: Bug Report
1
RadGridView: GridViewCheckBoxColumn incorrectly shows a header check mark when the last row still remains unchecked
This only happens initially when you first start checking/unchecking rows. See the attached gif file.
Attached Files:
1 comment
ADMIN
Nadya | Tech Support Engineer
Posted on: 30 Sep 2024 13:53

Hello, Julian,

Thank you for reporting this.

You can use the following workaround until the fix is available:

public class CustomCheckBoxHeaderCellElement : GridCheckBoxHeaderCellElement
{
    public CustomCheckBoxHeaderCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
    {
    }

    protected override void SetTwoStateCheckBoxState()
    {
        List<GridViewRowInfo> rows = new List<GridViewRowInfo>();
        MethodInfo mi = typeof(GridCheckBoxHeaderCellElement).GetTypeInfo().GetMethod("GetRowsToIterateOver", BindingFlags.Instance | BindingFlags.NonPublic);
        rows = mi.Invoke(this, null) as List<GridViewRowInfo>;

        bool? foundChecked = null;
        bool? foundUnchecked = null;
        bool? foundIndeterminate = null;

        bool isStateEvaluated = this.EvaluateCheckBoxState(rows, ref foundChecked, ref foundUnchecked, ref foundIndeterminate);
        if (!isStateEvaluated)
        {
            if (foundChecked.HasValue && !foundUnchecked.HasValue && !foundIndeterminate.HasValue)
            {
                this.SetCheckBoxState(ToggleState.On);
            }
            else
            {
                this.SetCheckBoxState(ToggleState.Off);
            }
        }
    }
}

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.