UIControllerForceSaveRow Property

Forces the UIController to perform the SavingRow event, when the user leaves the row. Overrides the default SavingRow event rules

Definition

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

Property Value

Boolean

Remarks

For more information about the default SavingRow event behavior, see the SavingRow event documentation.

Example

leave row
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 DemoLeaveRow
    {
        public void Run()
        {
            var jobs = new Pubs.Jobs();
            jobs.InitializeWithTestData();

            var uic = new UIController
                          {
                              From = jobs,
                              View = UITools.GenerateFormWithGridFor("SavingRow Demo",
                                                                     "Notice that the SavingRow event only happens for rows\n" +
                                                                     "That were, or if the ForceSaveRow checkbox is set.",
                                                       jobs.Id,
                                                       jobs.Description)
                          };

            var forceLeaveRowCheckBox = new CheckBox
                                            {
                                                Text = "Force Leave Row",
                                                Width = 120,
                                                Checked = uic.ForceSaveRow
                                            };
            forceLeaveRowCheckBox.CheckedChanged += (a, b) => uic.ForceSaveRow = forceLeaveRowCheckBox.Checked;

            UITools.AddControlsToForm(uic.View, forceLeaveRowCheckBox);

            uic.SavingRow += ( b) => MessageBox.Show("Leave Row Happened");

            uic.Run();
        }
    }
}

See Also