Completed
Last Updated: 19 Jan 2017 07:00 by ADMIN
ADMIN
Dimitar
Created on: 02 May 2016 12:08
Category: GridView
Type: Bug Report
0
FIX. RadGridView - the GridCheckBoxHeaderCellElement is not updated when a cell value is changed programmatically.
To reproduce:
private void radButton1_Click(object sender, EventArgs e)
{
    radGridView1.Rows[0].Cells[0].Value = false;
}

private void Form1_Load(object sender, EventArgs e)
{
    radGridView1.AllowSearchRow = true;
    radGridView1.TableElement.SearchHighlightColor = Color.Orange;
    radGridView1.AutoExpandGroups = true;

    DataTable dt = new DataTable();

    dt.Columns.Add("test", typeof(bool));

    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);
    dt.Rows.Add(true);

    radGridView1.DataSource = dt;

    ((Telerik.WinControls.UI.GridViewCheckBoxColumn) radGridView1.Columns[0]).EnableHeaderCheckBox = true;
    ((Telerik.WinControls.UI.GridViewCheckBoxColumn) radGridView1.Columns[0]).Width = radGridView1.Width - 50;

    radGridView1.TableElement.Update(Telerik.WinControls.UI.GridUINotifyAction.Reset); //force header checkbox to check

    radGridView1.TableElement.ScrollTo(15, 0);
}

Workaround:
private void radButton1_Click(object sender, EventArgs e)
{
    radGridView1.Rows[0].Cells[0].Value = false;
    radGridView1.TableElement.Update(Telerik.WinControls.UI.GridUINotifyAction.Reset); //force header checkbox to check
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments