Example #1
0
        private void DataSource_RowUpdated(object sender, DataRowChangeEventArgs e)
        {
            // TODO manually code this
            StatusMessage.Text = "Async Update Started";

            // put the e.Row into a DataSet for transport/update
            GridSettingsCD ds = new GridSettingsCD();

            ds.GridSettings.ImportRow(e.Row);

            //synch USE FOR DEBUGGING
            ds.UserName = SystemInformation.UserName;
            ds.GridName = "GridSettings";
            ds.ClientUpdateGridSettings(false);

            //async USE FOR PRODUCTION
            //ds.ClientUpdateGridSettingsCompleted += Async_UpdateCompleted;
            //ds.ClientUpdateGridSettings(true);
        }
Example #2
0
        private void Form_RetrieveData()
        {
            StatusMessage.Text = "Retrieving Data...";
            Grid.DisableRetrieveDataButton();

            DataSource_EventHandlers_Remove();

            _gridSettingsCD.UseWcfService   = false;
            _gridSettingsCD.UseAsmxService  = false;
            _gridSettingsCD.UseClientServer = true;


            _gridSettingsCD.ClientGetGridSettings(SystemInformation.UserName, "GridSettingsTest", false);
            // generate test data if it dos not exist
            if (_gridSettingsCD.Tables[0].Rows.Count == 0)
            {
                GridSettingsCD.GridSettingsRow gridSettingsRow;
                var displayIndex = 0;
                foreach (DataColumn column in _gridSettingsCD.Tables[0].Columns)
                {
                    gridSettingsRow = _gridSettingsCD.GridSettings.NewGridSettingsRow();
                    gridSettingsRow.SetDefaultValues();
                    gridSettingsRow.UserName     = SystemInformation.UserName;
                    gridSettingsRow.GridName     = "GridSettingsTest";
                    gridSettingsRow.ColumnName   = column.ColumnName;
                    gridSettingsRow.Visible      = true;
                    gridSettingsRow.DisplayIndex = displayIndex;
                    gridSettingsRow.Width        = 100 + displayIndex;
                    _gridSettingsCD.GridSettings.AddGridSettingsRow(gridSettingsRow);

                    displayIndex++;
                }
                _gridSettingsCD.ClientUpdateGridSettings(false);
                _gridSettingsCD.ClientGetGridSettings(SystemInformation.UserName, "GridSettingsTest", false);
            }
            Form_GetDataCompleted(this, new EventArgs());
        }