private void grdCostCentres_FocusRowLeaving(object sender, SourceGrid.RowCancelEventArgs e)
 {
     if (!FParentForm.CheckControlsValidateOk())
     {
         e.Cancel = true;
     }
 }
        private void HandleFocusRowLeaving(object sender, SourceGrid.RowCancelEventArgs e)
        {
            if (FDataSavingInUserControlRequiredFirst)
            {
                ShowMessageBoxTimer.Start();

                e.Cancel = true;
            }
        }
        private void HandleFocusRowLeaving(object sender, SourceGrid.RowCancelEventArgs e)
        {
            if (FDataSavingInUserControlRequiredFirst)
            {
                DataRowView rowView    = (DataRowView)grdDetails.Rows.IndexToDataSourceRow(e.ProposedRow);
                var         SelectedDR = rowView.Row as PPartnerAttributeCategoryRow;

                // This check is needed in case one of the promote/demote Buttons have got clicked: in that case
                // this Event will be fired, but the Row hasn't changed
                if (SelectedDR.CategoryCode != txtDetailCategoryCode.Text)
                {
                    ShowMessageBoxTimer.Start();

                    e.Cancel = true;
                }
            }
        }
Пример #4
0
        void Selection_FocusRowLeavingColumns(object sender, SourceGrid.RowCancelEventArgs e)
        {
            Program.RunSafe(() =>
            {
                var sel  = (SourceGrid.Selection.FreeSelection)sender;
                var grid = (SourceGrid.Grid)sel.Grid;
                var row  = grid.Rows[e.Row];
                //row.Tag = node
                var node       = row.Tag as NodeTable;
                GenTable table = node.Item;

                if (table != null)
                {
                    var cols = table.Columns.ToDictionary(p => p.ColumnName);

                    //addHeader(grid, 0, "ColumnName", 130);
                    //addHeader(grid, 1, "PropertyName", 130);
                    //addHeader(grid, 2, "Title", 250);
                    //addHeader(grid, 3, "DataType", 100);
                    //addHeader(grid, 4, "Required", 70);
                    //addHeader(grid, 5, "Description", 300);

                    for (int r = 1; r < grid.Rows.Count; r++)
                    {
                        var colName      = parseString(grid, r, 0);
                        var col          = cols[colName];
                        col.PropertyName = parseString(grid, r, 1);
                        col.Title        = parseString(grid, r, 2);
                        col.DataType     = parseString(grid, r, 3);
                        col.IsRequired   = Conv.ToBoolean(((SourceGrid.Cells.Cell)grid.GetCell(r, 4)).Value);
                        col.Description  = parseString(grid, r, 5);
                        col.Attributes   = parseString(grid, r, 6);
                    }
                }
            });
        }
Пример #5
0
 void Selection_FocusRowLeaving(object sender, SourceGrid.RowCancelEventArgs e)
 {
 }