Completed
Last Updated: 20 Oct 2016 13:06 by Irene
ADMIN
Boryana
Created on: 01 Mar 2012 09:31
Category: GridView
Type: Feature Request
4
ADD. RadGridView - allow pinned Items position modification in order to be able to always show the pinned summary row, instead of being show as the last row in the grid
Currently, if there are not enough rows to fill the height of RadGridView control, the pinned row will appear right after the last row. It will be good to facilitate customization that sets the pinned row to appear at the bottom of the grid. Same logic holds for summary rows and columns.

Workaround:

public Form1()
{
    InitializeComponent();

    DataTable dt = new DataTable();
    dt.Columns.Add("Id");
    dt.Columns.Add("Name");
    for (int i = 0; i < 5; i++)
    {
        dt.Rows.Add(i, "Item" + i);
    }

    this.radGridView1.DataSource = dt;
    this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;

    this.radGridView1.AllowSearchRow = true;
    this.radGridView1.SearchRowPosition = Telerik.WinControls.UI.SystemRowPosition.Bottom;

    this.radGridView1.ViewDefinition = new CustomTableViewDefition();
}

public class CustomTableViewDefition : TableViewDefinition
{
    public override IRowView CreateViewUIElement(GridViewInfo viewInfo)
    {
        return new CustomTableElement();
    }
}

public class CustomTableElement : GridTableElement
{
    protected override RowsContainerElement CreateViewElement()
    {
        return new CustomRowsContainerElement();
    }
}

public class CustomRowsContainerElement : RowsContainerElement
{
    protected override SizeF ArrangeOverride(SizeF finalSize)
    {
        float y = 0;

        this.TopPinnedRows.Arrange(new RectangleF(0, y, finalSize.Width, this.TopPinnedRows.DesiredSize.Height));
        y += this.TopPinnedRows.DesiredSize.Height + ElementSpacing;

        this.ScrollableRows.Arrange(new RectangleF(0, y, finalSize.Width, this.ScrollableRows.DesiredSize.Height));
        y += this.ScrollableRows.DesiredSize.Height + ElementSpacing;

        this.BottomPinnedRows.Arrange(new RectangleF(0, finalSize.Height - this.BottomPinnedRows.DesiredSize.Height,
            finalSize.Width, this.BottomPinnedRows.DesiredSize.Height));

        return finalSize;
    }
}
Attached Files:
4 comments
Irene
Posted on: 20 Oct 2016 13:06
Ok Stefan, thank you!!
ADMIN
Stefan
Posted on: 18 Oct 2016 08:38
Hi Irene,

the Service Pack is planned for Oct 25 and we are currently finalizing our work on it, so in a week or so, you will have it in your account.

-Stefan
Irene
Posted on: 18 Oct 2016 06:33
May I know when it will be launched this release? 

Thanks!
ADMIN
Ralitsa
Posted on: 28 Sep 2016 06:27
The improvement will be introduced in our next version of Telerik UI for WinForms - R3 2016 SP1. In order to change the position of pinned rows or search row at the bottom of the grid, you need to the BottomPinnedRowsMode property to Fixed.