How do I make the sort on child table work properly?

90 Views Asked by At

I am working with screen in a Lightswitch Desktop Client that is called ActiveClasses and which has a child table called RosterAttendences. I would to employ two sorts in the child table for the first field called "StudentVolunteer" and then on field called "Participants.LastName" as it looks in the snippet. However, at runtime the child table only sorts on the "StudentVolunteer" field. Is there a way to make the sort work as constructed?

Snippet from Lightswitch

1

There are 1 best solutions below

0
Dipen Shah On

Not an expert on LightSwitch but it seems someone already reported similar issue on MSDN.

It seems LightSwitch app remembers you sorting and based on the MSDN link mentioned earlier you can clear saved sorting options programatically. Following is the code snippet copied from here:

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);
    }
}