[This is preliminary documentation and is subject to change.]

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

Namespace:  Firefly.Box
Assembly:  Firefly.Box (in Firefly.Box.dll) Version: 3.4.23.6473 (3.4.23.6473)

Syntax

C#
public bool AllowSelect { get; set; }
Visual Basic (Declaration)
Public Property AllowSelect As Boolean
Visual C++
public:
property bool AllowSelect {
	bool get ();
	void set (bool value);
}

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).

Examples

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
CopyC#
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