Completed
Last Updated: 14 Oct 2015 08:10 by ADMIN
ADMIN
Dimitar
Created on: 12 Oct 2015 06:59
Category: GridView
Type: Bug Report
1
FIX. RadGridView - when a checkbox is checked in the grid wrong header cell is updated.
To reproduce:
private void RadForm1_Load(object sender, EventArgs e)
{
	DataTable dt = new DataTable();

	dt.Columns.Add("col1", typeof(bool));
	dt.Columns.Add("col2", typeof(bool));

	dt.Rows.Add(0, 1);
	dt.Rows.Add(0, 1);
	dt.Rows.Add(0, 1);

	RadGridView1.DataSource = dt;

	((Telerik.WinControls.UI.GridViewCheckBoxColumn)RadGridView1.Columns(0)).EnableHeaderCheckBox = true;
	((Telerik.WinControls.UI.GridViewCheckBoxColumn)RadGridView1.Columns(1)).EnableHeaderCheckBox = true;

	RadGridView1.HeaderCellToggleStateChanged += radGridView1_HeaderCellToggleStateChanged;

}

- Start the application and click in the second row in the first column.

Workaraound:
public class MyGridCheckBoxHeaderCellElement : GridCheckBoxHeaderCellElement
{
    public MyGridCheckBoxHeaderCellElement(GridViewDataColumn col, GridRowElement row)
        : base(col, row)
    { }
    protected override void SetCheckBoxState(ToggleState state)
    {
        if (this.ColumnInfo.Name != this.GridViewElement.CurrentCell.ColumnInfo.Name)
        {
            return;
        }
        base.SetCheckBoxState(state);
    }
}
0 comments