UIControllerAllowSelect Property

Gets or sets the value determining If the SelectCommand is enabled for the UIController

Definition

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

Property Value

Boolean

Remarks

Mostly used to implement selection lists
When the SelectCommand is enabled, and raised, the UIController will perform this SavingRow event, and exit.
The SelectCommand can be triggered by double clicking on any control on the form, or by it's keyboard shortcut (the default is the Enter key).

Example

using select
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.Windows.Forms;
using Firefly.Box;
namespace TestFirefly.Box.Documentation
{
    public class DemoSelect
    {
        public void Run()
        {
            var jobs = new Pubs.Jobs();
            jobs.InitializeWithTestData();

            var uic = new UIController
            {
                From = jobs,
                Activity = Activities.Browse,
                AllowSelect = true,
                View = UITools.GenerateFormWithGridFor("Select Demo",
                                                       "Select the current value by one of the following methods:\n" +
                                                       "Click the select button.\n" +
                                                       "Press the enter key.\n" +
                                                       "Double Click on any control.",
                                                       jobs.Id,
                                                       jobs.Description)
            };
            var selectButton = new Button
            {
                Text = "Select"
            };
            selectButton.Click += (a, b) => uic.Raise(Command.Select);
            UITools.AddControlsToForm(uic.View, selectButton);

            uic.SavingRow += ( b) => MessageBox.Show("The selected value is " + jobs.Id.ToString().Trim());
            uic.Run();
        }
    }
}

See Also