Example #1
0
        public FormHost()
        {
            InitializeComponent();

            DataHost = new DataHost();
            DataHost.Tables.Add("Persons");
            DataHost.Tables.Add("Products");

            dataDisplayControl1.OnConnect(DataHost, "Persons");
            dataDisplayControl2.OnConnect(DataHost, "Products");
            dataDisplayControl3.OnConnect(DataHost, "Persons");
            dataDisplayControl4.OnConnect(DataHost, "Products");

            buttonSaveChanges.DataBindings.Add("Enabled", dataDisplayControl1.Context, "ContainsLocalChanges", false, DataSourceUpdateMode.Never);
            buttonCancelChanges.DataBindings.Add("Enabled", dataDisplayControl1.Context, "ContainsLocalChanges", false, DataSourceUpdateMode.Never);

            buttonDoUndo.DataBindings.Add("Enabled", dataDisplayControl1.Context.Commands, "CanBackward", false, DataSourceUpdateMode.Never);
            buttonDoRedo.DataBindings.Add("Enabled", dataDisplayControl1.Context.Commands, "CanForward", false, DataSourceUpdateMode.Never);
        }
Example #2
0
        public FormHost()
        {
            InitializeComponent();

            DataHost = new DataHost();
            DataHost.Tables.Add("Persons");
            DataHost.Tables.Add("Products");

            dataDisplayControl1.OnConnect(DataHost, "Persons");
            dataDisplayControl2.OnConnect(DataHost, "Products");
            dataDisplayControl3.OnConnect(DataHost, "Persons");
            dataDisplayControl4.OnConnect(DataHost, "Products");

            buttonSaveChanges.DataBindings.Add("Enabled", dataDisplayControl1.Context, "ContainsLocalChanges", false, DataSourceUpdateMode.Never);
            buttonCancelChanges.DataBindings.Add("Enabled", dataDisplayControl1.Context, "ContainsLocalChanges", false, DataSourceUpdateMode.Never);

            buttonDoUndo.DataBindings.Add("Enabled", dataDisplayControl1.Context.Commands, "CanBackward", false, DataSourceUpdateMode.Never);
            buttonDoRedo.DataBindings.Add("Enabled", dataDisplayControl1.Context.Commands, "CanForward", false, DataSourceUpdateMode.Never);
        }