locked
Datasource order changed while sorting and grouping in server side. RRS feed

  • Question

  • Hi All, 

    We have tried asp sorting and grouping the datasource the order will be changed. But in client side working fine. We have attached code snippet below.

    List<accs> acc = new List<accs>();

                acc.Add(new accs() { Account = "4320", Content = "Invest" });

                acc.Add(new accs() { Account = "4290", Content = "rewrw" });

                acc.Add(new accs() { Account = "4290", Content = "test11" });

        

                var list = acc.OrderBy(x => x.Content);

                var t = list.GroupBy(p => p.Account, p => p.Content, (key, g) => new { Account = key, Content = g.ToList() });

    return View();

    serverside output:

    0-Account="4320"

    1-Account="4290"

    ClientSide output:

    0-Account="4290"

    1-Account="4320"

    Please let me know if you have any solution.

    Regards,

    Gopi G.

    Thursday, November 2, 2017 1:27 PM

Answers

  • I'd ask for help over here in microsoft official ASP.Net forums

    https://forums.asp.net/

     or classic

    https://forums.iis.net/1044.aspx/1?Classic+ASP

     

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.



    • Edited by Dave PatrickMVP Thursday, November 2, 2017 1:40 PM
    • Proposed as answer by pituachMVP Thursday, November 2, 2017 3:47 PM
    • Marked as answer by Just Karl Monday, November 13, 2017 4:41 PM
    Thursday, November 2, 2017 1:38 PM