UIControllerOrderBy Property

Gets or sets the value determining order in which the rows are ordered

Definition

Namespace: Firefly.Box
Assembly: Firefly.Box (in Firefly.Box.dll) Version: debug-master-v:33791
C#
public Sort OrderBy { get; set; }

Property Value

Sort

Remarks

Performance tip - Any OrderBy that is based only on columns that are part of the Task Main Query(*) will be performed by the database.
Otherwise the OrderBy
will be performed in memory, resulting in a performance penalty in cases where many rows are involved
(*)Task Main Query - includes the entity defined in the From property, and any entity that is part of a relation (as defined in the Relations property collection) that is of type Join or OuterJoin

Example

Using Sort And Reverse Row Order
This example is based on test data. The code for the entities included in this test data can be found in the documentation of Entity
This example uses automatic tools to generate parts of the user interface. Those tools can be found in the example of the documentation of Form
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Firefly.Box;

namespace TestFirefly.Box.Documentation
{
    public class ReverseRowOrderDemo
    {
        public void Run()
        {
            var jobs = new Pubs.Jobs();
            jobs.InitializeWithTestData();

            var uic = new UIController()
            {
                From = jobs,
                View = UITools.GenerateFormWithGridFor("Order By And Reversed Row Order",
                                                       "Notice that the rows are ordered by job id, \n"+
                                                       "and that the order is reversed.",
                                                       jobs.Id,
                                                       jobs.Description,
                                                       jobs.MinLevel,
                                                       jobs.MaxLevel)
            };
            uic.OrderBy.Segments.Add(jobs.Id);
            uic.OrderBy.Reversed = true;
            uic.Run();
        }
    }
}

See Also