UIControllerAllowSelect Property
Namespace: Firefly.BoxAssembly: Firefly.Box (in Firefly.Box.dll) Version: debug-master-v:33791
public bool AllowSelect { get; set; }
Public Property AllowSelect As Boolean
Get
Set
member AllowSelect : bool with get, set
Property Value
Boolean 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).
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
EntityThis example uses automatic tools to generate parts of the user interface. Those tools can be found in the example of the documentation of
Formusing 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();
}
}
}