Completed
Last Updated: 04 Jan 2017 15:58 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 22 Sep 2016 08:50
Category: GridView
Type: Bug Report
0
FIX. RadGridView - broken layout when resizing and HtmlViewDefinition is applied
To reproduce:

public Form1()
{
    InitializeComponent();
    for (int i = 0; i < 10; i++)
    {
        this.radGridView1.Columns.Add("column " + i);
    }

    int charsCount = 5;
    for (int i = 0; i < 20; i++)
    {
        this.radGridView1.Rows.Add(new string('0', charsCount), new string('1', charsCount), 
            new string('2', charsCount), new string('3', charsCount), new string('4', charsCount),
            new string('5', charsCount), new string('6', charsCount), new string('7', charsCount), 
            new string('8', charsCount), new string('9', charsCount));
    }
    HtmlViewDefinition view = new HtmlViewDefinition();
    view.RowTemplate.Rows.Add(new RowDefinition());
    view.RowTemplate.Rows.Add(new RowDefinition());
    view.RowTemplate.Rows.Add(new RowDefinition());
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 0", 0, 1, 1));
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 1", 0, 1, 3));
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 2", 0, 1, 1));
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 3", 0, 1, 1));
    view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Column 7", 0, 1, 1));
    view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Column 4", 0, 1, 2));
    view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Column 5", 0, 2, 1));
    view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Column 8", 0, 1, 1));
    view.RowTemplate.Rows[2].Cells.Add(new CellDefinition("Column 6", 0, 2, 1));
    view.RowTemplate.Rows[2].Cells.Add(new CellDefinition("Column 9", 0, 1, 1));

    this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

    this.radGridView1.ViewDefinition = view;
}

Workaround:
private void radGridView1_SizeChanged(object sender, EventArgs e)
{
    this.radGridView1.MasterTemplate.Refresh();
}

Attached Files:
0 comments