Under Review
Last Updated: 18 Sep 2020 12:53 by ADMIN
Lee Nessling
Created on: 18 Sep 2020 12:48
Category: Grid
Type: Bug Report
0
Column reordering breaks grid that is bound on the client side.

Reproduction of the issue

RadGrid declaration

<telerik:RadButton runat="server" Text="PostBack"  AutoPostBack="true"></telerik:RadButton>
<telerik:RadGrid runat="server" ID="RadGrid2">
    <MasterTableView DataKeyNames="Column1" ClientDataKeyNames="Column1" CommandItemDisplay="Top">
            <Columns>
            <telerik:GridBoundColumn UniqueName="Col1" DataField="Column1" HeaderText="Col1"s></telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Col2" DataField="Column2" HeaderText="Col2"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Co13" DataField="Column3" HeaderText="Co13"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Col4" DataField="Column4" HeaderText="Col4"></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings ReorderColumnsOnClient="false" AllowColumnsReorder="true">
            <DataBinding Location="~/Api/RevCodeGrid" SelectMethod="GetDataAndCount2"   >
        </DataBinding>
    </ClientSettings>
</telerik:RadGrid>

 

RevCodeGridController

public class Test
{
    public String Column1 { get; set; }
    public String Column2 { get; set; }
    public String Column3 { get; set; }
    public String Column4 { get; set; }
}


[HttpPost]
public virtual RadGridResultData GetDataAndCount2(object context)
{
    List<Test> items = new List<Test>();
    items.Add(new Test() { Column1 = "1", Column2 = "A", Column3 = "A1", Column4 = "A12" });
    items.Add(new Test() { Column1 = "2", Column2 = "B", Column3 = "B1", Column4 = "B12" });
    items.Add(new Test() { Column1 = "3", Column2 = "C", Column3 = "C1", Column4 = "C12" });
    items.Add(new Test() { Column1 = "4", Column2 = "D", Column3 = "D1", Column4 = "D12" });

    return new RadGridResultData { Data = items, Count = items.Count };
}

 

 

 

 

 

 

 

0 comments