【问题标题】:How do I make the sort on child table work properly?如何使子表上的排序正常工作?
【发布时间】:2019-01-22 16:41:24
【问题描述】:

我正在使用名为 ActiveClasses 的 Lightswitch 桌面客户端中的屏幕,它有一个名为 RosterAttendences 的子表。我会在子表中为第一个名为“StudentVolunteer”的字段使用两种排序,然后在名为“Participants.LastName”的字段上使用它,因为它在 sn-p 中看起来。但是,在运行时,子表仅按“StudentVolunteer”字段排序。有没有办法使排序按构造工作?

【问题讨论】:

    标签: visual-studio-lightswitch


    【解决方案1】:

    不是 LightSwitch 方面的专家,但似乎有人已经举报了 similar issue on MSDN。

    LightSwitch 应用程序似乎记住了您的排序,并且基于前面提到的 MSDN 链接,您可以以编程方式清除保存的排序选项。以下是从here复制的代码sn-p:

    partial void Application_Initialize()
    {
        IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings;
        var sortAndColumnSettings = appSettings.Where(
            setting => setting.Key.Contains("SortSettings") 
                    || setting.Key.Contains("ColumnSettings")
        ).ToList();
    
        foreach (var setting in sortAndColumnSettings)
        {
           appSettings.Remove(setting.Key);
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多