/// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn2 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn1 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewComboBoxColumn gridViewComboBoxColumn1 = new Telerik.WinControls.UI.GridViewComboBoxColumn();
            Telerik.WinControls.UI.TableViewDefinition tableViewDefinition1 = new Telerik.WinControls.UI.TableViewDefinition();
            this.gvDailyMeasures = new Telerik.WinControls.UI.RadGridView();
            this.lbAggregate = new Telerik.WinControls.UI.RadLabel();
            this.btnSave = new Telerik.WinControls.UI.RadButton();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.ucWeekSelection = new Avicola.Production.Win.UserControls.UcWeekSelection();
            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
            this.txtTotal = new Telerik.WinControls.UI.RadTextBox();
            ((System.ComponentModel.ISupportInitialize)(this.gvDailyMeasures)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvDailyMeasures.MasterTemplate)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.lbAggregate)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.btnSave)).BeginInit();
            this.tableLayoutPanel1.SuspendLayout();
            this.tableLayoutPanel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtTotal)).BeginInit();
            this.SuspendLayout();
            // 
            // gvDailyMeasures
            // 
            this.gvDailyMeasures.Dock = System.Windows.Forms.DockStyle.Fill;
            this.gvDailyMeasures.Font = new System.Drawing.Font("Segoe UI", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.gvDailyMeasures.Location = new System.Drawing.Point(3, 84);
            // 
            // 
            // 
            this.gvDailyMeasures.MasterTemplate.AllowAddNewRow = false;
            this.gvDailyMeasures.MasterTemplate.AllowColumnReorder = false;
            this.gvDailyMeasures.MasterTemplate.AllowDeleteRow = false;
            this.gvDailyMeasures.MasterTemplate.AllowDragToGroup = false;
            this.gvDailyMeasures.MasterTemplate.AutoGenerateColumns = false;
            this.gvDailyMeasures.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            gridViewTextBoxColumn1.FieldName = "Day";
            gridViewTextBoxColumn1.HeaderText = "Día";
            gridViewTextBoxColumn1.Name = "Day";
            gridViewTextBoxColumn1.ReadOnly = true;
            gridViewTextBoxColumn1.Width = 156;
            gridViewTextBoxColumn2.FieldName = "Date";
            gridViewTextBoxColumn2.FormatString = "{0: dd/M/yyyy}";
            gridViewTextBoxColumn2.HeaderText = "Fecha";
            gridViewTextBoxColumn2.Name = "Date";
            gridViewTextBoxColumn2.ReadOnly = true;
            gridViewTextBoxColumn2.Width = 127;
            gridViewDecimalColumn1.EnableExpressionEditor = false;
            gridViewDecimalColumn1.Expression = "";
            gridViewDecimalColumn1.FieldName = "Value";
            gridViewDecimalColumn1.FormatString = "{0:N2}";
            gridViewDecimalColumn1.HeaderText = "Valor";
            gridViewDecimalColumn1.Name = "Value";
            gridViewDecimalColumn1.Width = 120;
            gridViewComboBoxColumn1.DisplayMember = "Name";
            gridViewComboBoxColumn1.FieldName = "FoodClassId";
            gridViewComboBoxColumn1.HeaderText = "Clase";
            gridViewComboBoxColumn1.MinWidth = 160;
            gridViewComboBoxColumn1.Name = "FoodClassId";
            gridViewComboBoxColumn1.ValueMember = "Id";
            gridViewComboBoxColumn1.Width = 160;
            this.gvDailyMeasures.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
            gridViewTextBoxColumn1,
            gridViewTextBoxColumn2,
            gridViewDecimalColumn1,
            gridViewComboBoxColumn1});
            this.gvDailyMeasures.MasterTemplate.ViewDefinition = tableViewDefinition1;
            this.gvDailyMeasures.Name = "gvDailyMeasures";
            this.gvDailyMeasures.Size = new System.Drawing.Size(580, 215);
            this.gvDailyMeasures.TabIndex = 5;
            this.gvDailyMeasures.RowFormatting += new Telerik.WinControls.UI.RowFormattingEventHandler(this.gvDailyMeasures_RowFormatting);
            this.gvDailyMeasures.CellBeginEdit += new Telerik.WinControls.UI.GridViewCellCancelEventHandler(this.gvDailyMeasures_CellBeginEdit);
            this.gvDailyMeasures.CellValueChanged += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gvDailyMeasures_CellValueChanged);
            this.gvDailyMeasures.ToolTipTextNeeded += new Telerik.WinControls.ToolTipTextNeededEventHandler(this.gvDailyMeasures_ToolTipTextNeeded);
            // 
            // lbAggregate
            // 
            this.lbAggregate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.lbAggregate.Font = new System.Drawing.Font("Segoe UI", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lbAggregate.Location = new System.Drawing.Point(3, 3);
            this.lbAggregate.Name = "lbAggregate";
            this.lbAggregate.Size = new System.Drawing.Size(72, 40);
            this.lbAggregate.TabIndex = 7;
            this.lbAggregate.Text = "Total:";
            // 
            // btnSave
            // 
            this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnSave.Location = new System.Drawing.Point(484, 4);
            this.btnSave.Name = "btnSave";
            this.btnSave.Size = new System.Drawing.Size(95, 39);
            this.btnSave.TabIndex = 8;
            this.btnSave.Text = "Guardar";
            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
            // 
            // tableLayoutPanel1
            // 
            this.tableLayoutPanel1.ColumnCount = 1;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.Controls.Add(this.ucWeekSelection, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.gvDailyMeasures, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 2);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 3;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 81F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(586, 352);
            this.tableLayoutPanel1.TabIndex = 9;
            // 
            // ucWeekSelection
            // 
            this.ucWeekSelection.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.ucWeekSelection.Current = 0;
            this.ucWeekSelection.Location = new System.Drawing.Point(4, 4);
            this.ucWeekSelection.Margin = new System.Windows.Forms.Padding(4);
            this.ucWeekSelection.MaxWeekNumber = 0;
            this.ucWeekSelection.MinimumSize = new System.Drawing.Size(0, 70);
            this.ucWeekSelection.MinWeekNumber = 0;
            this.ucWeekSelection.Name = "ucWeekSelection";
            this.ucWeekSelection.Size = new System.Drawing.Size(578, 70);
            this.ucWeekSelection.TabIndex = 0;
            this.ucWeekSelection.CurrentWeekChanged += new System.EventHandler<int>(this.ucWeekSelection_CurrentWeekChanged);
            // 
            // tableLayoutPanel2
            // 
            this.tableLayoutPanel2.ColumnCount = 3;
            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.33238F));
            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 83.66762F));
            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 104F));
            this.tableLayoutPanel2.Controls.Add(this.lbAggregate, 0, 0);
            this.tableLayoutPanel2.Controls.Add(this.btnSave, 2, 0);
            this.tableLayoutPanel2.Controls.Add(this.txtTotal, 1, 0);
            this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel2.Location = new System.Drawing.Point(2, 304);
            this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(2);
            this.tableLayoutPanel2.Name = "tableLayoutPanel2";
            this.tableLayoutPanel2.RowCount = 1;
            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel2.Size = new System.Drawing.Size(582, 46);
            this.tableLayoutPanel2.TabIndex = 6;
            // 
            // txtTotal
            // 
            this.txtTotal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.txtTotal.Enabled = false;
            this.txtTotal.Font = new System.Drawing.Font("Segoe UI", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtTotal.Location = new System.Drawing.Point(81, 3);
            this.txtTotal.Name = "txtTotal";
            this.txtTotal.Size = new System.Drawing.Size(94, 40);
            this.txtTotal.TabIndex = 6;
            // 
            // UcLoadDailyMeasures
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.tableLayoutPanel1);
            this.Name = "UcLoadDailyMeasures";
            this.Size = new System.Drawing.Size(586, 352);
            this.Load += new System.EventHandler(this.UcLoadDailyMeasures_Load);
            ((System.ComponentModel.ISupportInitialize)(this.gvDailyMeasures.MasterTemplate)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvDailyMeasures)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.lbAggregate)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.btnSave)).EndInit();
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel2.ResumeLayout(false);
            this.tableLayoutPanel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtTotal)).EndInit();
            this.ResumeLayout(false);

        }
Beispiel #2
0
        private void FormatDataGrid()
        {
            try
            {
                Telerik.WinControls.UI.Localization.RadGridLocalizationProvider.CurrentProvider = new Infrastructure.WinForms.Controls.MySpanishRadGridLocalizationProvider();
                this.grdItems.Columns.Clear();
                this.grdItems.AllowAddNewRow = false;
                Telerik.WinControls.UI.GridViewCommandColumn commandColumn;
                commandColumn                = new Telerik.WinControls.UI.GridViewCommandColumn();
                commandColumn.Name           = "Edit";
                commandColumn.HeaderText     = "Editar";
                commandColumn.DefaultText    = "Editar";
                commandColumn.UseDefaultText = true;
                this.grdItems.Columns.Add(commandColumn);
                this.grdItems.Columns["Edit"].AllowSort      = false;
                this.grdItems.Columns["Edit"].AllowFiltering = false;
                commandColumn                = new Telerik.WinControls.UI.GridViewCommandColumn();
                commandColumn.Name           = "Delete";
                commandColumn.HeaderText     = "Eliminar";
                commandColumn.DefaultText    = "Eliminar";
                commandColumn.UseDefaultText = true;
                this.grdItems.Columns.Add(commandColumn);
                this.grdItems.Columns["Delete"].AllowSort      = false;
                this.grdItems.Columns["Delete"].AllowFiltering = false;


                Infrastructure.WinForms.Controls.ComboBox.ComboxBoxItem.AddComboBoxItem(0, "Neutral", true);
                Infrastructure.WinForms.Controls.ComboBox.ComboxBoxItem.AddComboBoxItem(1, "Positivo");
                Infrastructure.WinForms.Controls.ComboBox.ComboxBoxItem.AddComboBoxItem(-1, "Negativo");

                Telerik.WinControls.UI.GridViewComboBoxColumn tipoGestionColumn = new Telerik.WinControls.UI.GridViewComboBoxColumn();
                tipoGestionColumn.Name          = "RESG_PositivoNegativo";
                tipoGestionColumn.HeaderText    = "Tipo Result. Gestión";
                tipoGestionColumn.DataSource    = Infrastructure.WinForms.Controls.ComboBox.ComboxBoxItem.GetComboBoxItems();
                tipoGestionColumn.ValueMember   = "IntCodigo";
                tipoGestionColumn.DisplayMember = "StrDesc";
                tipoGestionColumn.FieldName     = "RESG_PositivoNegativo";
                tipoGestionColumn.Width         = 200;

                this.grdItems.Columns.Add(tipoGestionColumn);
                this.grdItems.Columns.Add("RESG_Desc", "Descripción", "RESG_Desc");
                this.grdItems.Columns.Add("RESG_DescC", "Descripción Corta", "RESG_DescC");

                grdItems.BestFitColumns();

                tsmColumnas.DropDownItems.Clear();
                defaultColumns = new string[grdItems.Columns.Count];
                int index = 0;
                foreach (Telerik.WinControls.UI.GridViewDataColumn column in grdItems.Columns)
                {
                    ToolStripMenuItem _item = new ToolStripMenuItem(column.HeaderText);
                    _item.Tag          = column.Name;
                    _item.Checked      = column.IsVisible;
                    _item.CheckOnClick = true;
                    _item.Click       += new EventHandler(tsmColumna_Click);
                    tsmColumnas.DropDownItems.Add(_item);

                    if (column.IsVisible)
                    {
                        defaultColumns[index] = column.Name; index += 1;
                    }
                }

                ToolStripSeparator tsmSeparacion = new ToolStripSeparator();
                tsmColumnas.DropDownItems.Add(tsmSeparacion);
                tsmTodos              = new ToolStripMenuItem("Todos");
                tsmTodos.Tag          = "Todas";
                tsmTodos.Checked      = false;
                tsmTodos.CheckOnClick = true;
                tsmTodos.Click       += new EventHandler(tsmTodos_Click);
                tsmColumnas.DropDownItems.Add(tsmTodos);

                Infrastructure.WinForms.Controls.GridAutoFit.Fit(grdItems);

                this.grdItems.Columns["RESG_PositivoNegativo"].TextAlignment = ContentAlignment.MiddleLeft;
            }
            catch (Exception ex)
            { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Presenter.Title, Infrastructure.Aspect.Constants.Mensajes.FormatDataGridView, ex); }
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     Telerik.WinControls.UI.GridViewTextBoxColumn  gridViewTextBoxColumn1  = new Telerik.WinControls.UI.GridViewTextBoxColumn();
     Telerik.WinControls.UI.GridViewTextBoxColumn  gridViewTextBoxColumn2  = new Telerik.WinControls.UI.GridViewTextBoxColumn();
     Telerik.WinControls.UI.GridViewDecimalColumn  gridViewDecimalColumn1  = new Telerik.WinControls.UI.GridViewDecimalColumn();
     Telerik.WinControls.UI.GridViewComboBoxColumn gridViewComboBoxColumn1 = new Telerik.WinControls.UI.GridViewComboBoxColumn();
     Telerik.WinControls.UI.TableViewDefinition    tableViewDefinition1    = new Telerik.WinControls.UI.TableViewDefinition();
     this.gvDailyMeasures   = new Telerik.WinControls.UI.RadGridView();
     this.lbAggregate       = new Telerik.WinControls.UI.RadLabel();
     this.btnSave           = new Telerik.WinControls.UI.RadButton();
     this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
     this.ucWeekSelection   = new Avicola.Production.Win.UserControls.UcWeekSelection();
     this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
     this.txtTotal          = new Telerik.WinControls.UI.RadTextBox();
     ((System.ComponentModel.ISupportInitialize)(this.gvDailyMeasures)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gvDailyMeasures.MasterTemplate)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lbAggregate)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.btnSave)).BeginInit();
     this.tableLayoutPanel1.SuspendLayout();
     this.tableLayoutPanel2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.txtTotal)).BeginInit();
     this.SuspendLayout();
     //
     // gvDailyMeasures
     //
     this.gvDailyMeasures.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gvDailyMeasures.Font     = new System.Drawing.Font("Segoe UI", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.gvDailyMeasures.Location = new System.Drawing.Point(3, 84);
     //
     //
     //
     this.gvDailyMeasures.MasterTemplate.AllowAddNewRow      = false;
     this.gvDailyMeasures.MasterTemplate.AllowColumnReorder  = false;
     this.gvDailyMeasures.MasterTemplate.AllowDeleteRow      = false;
     this.gvDailyMeasures.MasterTemplate.AllowDragToGroup    = false;
     this.gvDailyMeasures.MasterTemplate.AutoGenerateColumns = false;
     this.gvDailyMeasures.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
     gridViewTextBoxColumn1.FieldName              = "Day";
     gridViewTextBoxColumn1.HeaderText             = "Día";
     gridViewTextBoxColumn1.Name                   = "Day";
     gridViewTextBoxColumn1.ReadOnly               = true;
     gridViewTextBoxColumn1.Width                  = 156;
     gridViewTextBoxColumn2.FieldName              = "Date";
     gridViewTextBoxColumn2.FormatString           = "{0: dd/M/yyyy}";
     gridViewTextBoxColumn2.HeaderText             = "Fecha";
     gridViewTextBoxColumn2.Name                   = "Date";
     gridViewTextBoxColumn2.ReadOnly               = true;
     gridViewTextBoxColumn2.Width                  = 127;
     gridViewDecimalColumn1.EnableExpressionEditor = false;
     gridViewDecimalColumn1.Expression             = "";
     gridViewDecimalColumn1.FieldName              = "Value";
     gridViewDecimalColumn1.FormatString           = "{0:N2}";
     gridViewDecimalColumn1.HeaderText             = "Valor";
     gridViewDecimalColumn1.Name                   = "Value";
     gridViewDecimalColumn1.Width                  = 120;
     gridViewComboBoxColumn1.DisplayMember         = "Name";
     gridViewComboBoxColumn1.FieldName             = "FoodClassId";
     gridViewComboBoxColumn1.HeaderText            = "Clase";
     gridViewComboBoxColumn1.MinWidth              = 160;
     gridViewComboBoxColumn1.Name                  = "FoodClassId";
     gridViewComboBoxColumn1.ValueMember           = "Id";
     gridViewComboBoxColumn1.Width                 = 160;
     this.gvDailyMeasures.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
         gridViewTextBoxColumn1,
         gridViewTextBoxColumn2,
         gridViewDecimalColumn1,
         gridViewComboBoxColumn1
     });
     this.gvDailyMeasures.MasterTemplate.ViewDefinition = tableViewDefinition1;
     this.gvDailyMeasures.Name               = "gvDailyMeasures";
     this.gvDailyMeasures.Size               = new System.Drawing.Size(580, 215);
     this.gvDailyMeasures.TabIndex           = 5;
     this.gvDailyMeasures.RowFormatting     += new Telerik.WinControls.UI.RowFormattingEventHandler(this.gvDailyMeasures_RowFormatting);
     this.gvDailyMeasures.CellBeginEdit     += new Telerik.WinControls.UI.GridViewCellCancelEventHandler(this.gvDailyMeasures_CellBeginEdit);
     this.gvDailyMeasures.CellValueChanged  += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gvDailyMeasures_CellValueChanged);
     this.gvDailyMeasures.ToolTipTextNeeded += new Telerik.WinControls.ToolTipTextNeededEventHandler(this.gvDailyMeasures_ToolTipTextNeeded);
     //
     // lbAggregate
     //
     this.lbAggregate.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.lbAggregate.Font     = new System.Drawing.Font("Segoe UI", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lbAggregate.Location = new System.Drawing.Point(3, 3);
     this.lbAggregate.Name     = "lbAggregate";
     this.lbAggregate.Size     = new System.Drawing.Size(72, 40);
     this.lbAggregate.TabIndex = 7;
     this.lbAggregate.Text     = "Total:";
     //
     // btnSave
     //
     this.btnSave.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnSave.Location = new System.Drawing.Point(484, 4);
     this.btnSave.Name     = "btnSave";
     this.btnSave.Size     = new System.Drawing.Size(95, 39);
     this.btnSave.TabIndex = 8;
     this.btnSave.Text     = "Guardar";
     this.btnSave.Click   += new System.EventHandler(this.btnSave_Click);
     //
     // tableLayoutPanel1
     //
     this.tableLayoutPanel1.ColumnCount = 1;
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     this.tableLayoutPanel1.Controls.Add(this.ucWeekSelection, 0, 0);
     this.tableLayoutPanel1.Controls.Add(this.gvDailyMeasures, 0, 1);
     this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 2);
     this.tableLayoutPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
     this.tableLayoutPanel1.Margin   = new System.Windows.Forms.Padding(2);
     this.tableLayoutPanel1.Name     = "tableLayoutPanel1";
     this.tableLayoutPanel1.RowCount = 3;
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 81F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
     this.tableLayoutPanel1.Size     = new System.Drawing.Size(586, 352);
     this.tableLayoutPanel1.TabIndex = 9;
     //
     // ucWeekSelection
     //
     this.ucWeekSelection.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                         | System.Windows.Forms.AnchorStyles.Right)));
     this.ucWeekSelection.Current             = 0;
     this.ucWeekSelection.Location            = new System.Drawing.Point(4, 4);
     this.ucWeekSelection.Margin              = new System.Windows.Forms.Padding(4);
     this.ucWeekSelection.MaxWeekNumber       = 0;
     this.ucWeekSelection.MinimumSize         = new System.Drawing.Size(0, 70);
     this.ucWeekSelection.MinWeekNumber       = 0;
     this.ucWeekSelection.Name                = "ucWeekSelection";
     this.ucWeekSelection.Size                = new System.Drawing.Size(578, 70);
     this.ucWeekSelection.TabIndex            = 0;
     this.ucWeekSelection.CurrentWeekChanged += new System.EventHandler <int>(this.ucWeekSelection_CurrentWeekChanged);
     //
     // tableLayoutPanel2
     //
     this.tableLayoutPanel2.ColumnCount = 3;
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.33238F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 83.66762F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 104F));
     this.tableLayoutPanel2.Controls.Add(this.lbAggregate, 0, 0);
     this.tableLayoutPanel2.Controls.Add(this.btnSave, 2, 0);
     this.tableLayoutPanel2.Controls.Add(this.txtTotal, 1, 0);
     this.tableLayoutPanel2.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.tableLayoutPanel2.Location = new System.Drawing.Point(2, 304);
     this.tableLayoutPanel2.Margin   = new System.Windows.Forms.Padding(2);
     this.tableLayoutPanel2.Name     = "tableLayoutPanel2";
     this.tableLayoutPanel2.RowCount = 1;
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
     this.tableLayoutPanel2.Size     = new System.Drawing.Size(582, 46);
     this.tableLayoutPanel2.TabIndex = 6;
     //
     // txtTotal
     //
     this.txtTotal.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.txtTotal.Enabled  = false;
     this.txtTotal.Font     = new System.Drawing.Font("Segoe UI", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtTotal.Location = new System.Drawing.Point(81, 3);
     this.txtTotal.Name     = "txtTotal";
     this.txtTotal.Size     = new System.Drawing.Size(94, 40);
     this.txtTotal.TabIndex = 6;
     //
     // UcLoadDailyMeasures
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.tableLayoutPanel1);
     this.Name  = "UcLoadDailyMeasures";
     this.Size  = new System.Drawing.Size(586, 352);
     this.Load += new System.EventHandler(this.UcLoadDailyMeasures_Load);
     ((System.ComponentModel.ISupportInitialize)(this.gvDailyMeasures.MasterTemplate)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gvDailyMeasures)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lbAggregate)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.btnSave)).EndInit();
     this.tableLayoutPanel1.ResumeLayout(false);
     this.tableLayoutPanel2.ResumeLayout(false);
     this.tableLayoutPanel2.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.txtTotal)).EndInit();
     this.ResumeLayout(false);
 }
Beispiel #4
0
        protected virtual CellPrintElement CreateDataCellPrintElement(
            GridViewCellInfo cellInfo)
        {
            CellPrintElement cellPrintElement;

            if (cellInfo.ColumnInfo is GridViewImageColumn)
            {
                cellPrintElement          = this.CreateImageCellPrintElement(cellInfo);
                cellPrintElement.DrawText = false;
            }
            else
            {
                cellPrintElement = new CellPrintElement();
            }
            if (this.GridView.PrintStyle.PrintAlternatingRowColor && this.GridView.PrintStyle.PrintTraverser.Current.Index % 2 == 1)
            {
                cellPrintElement.BackColor = this.GridView.PrintStyle.AlternatingRowColor;
            }
            else
            {
                cellPrintElement.BackColor = this.GridView.PrintStyle.CellBackColor;
            }
            cellPrintElement.BorderColor = this.GridView.PrintStyle.BorderColor;
            Color backColor = cellPrintElement.BackColor;

            if (cellPrintElement.BackColor != Color.Transparent && cellPrintElement.BackColor != Color.Empty)
            {
                cellPrintElement.DrawFill = true;
            }
            GridViewDataColumn     columnInfo1 = cellInfo.ColumnInfo as GridViewDataColumn;
            object                 lookupValue = cellInfo.Value;
            GridViewComboBoxColumn columnInfo2 = cellInfo.ColumnInfo as GridViewComboBoxColumn;

            if (columnInfo2 != null && columnInfo2.HasLookupValue)
            {
                lookupValue = columnInfo2.GetLookupValue(lookupValue);
            }
            if (columnInfo1 != null && !string.IsNullOrEmpty(columnInfo1.FormatString))
            {
                if (cellInfo.ColumnInfo is GridViewComboBoxColumn)
                {
                    GridViewComboBoxColumn columnInfo3 = (GridViewComboBoxColumn)cellInfo.ColumnInfo;
                    columnInfo1.DataType          = columnInfo3.DisplayMemberDataType;
                    columnInfo1.DataTypeConverter = TypeDescriptor.GetConverter(columnInfo3.DisplayMemberDataType);
                    cellPrintElement.Text         = RadDataConverter.Instance.Format(lookupValue, typeof(string), (IDataConversionInfoProvider)columnInfo1) as string;
                }
                else
                {
                    cellPrintElement.Text = RadDataConverter.Instance.Format(lookupValue, typeof(string), (IDataConversionInfoProvider)columnInfo1) as string;
                }
            }
            else
            {
                cellPrintElement.Text = lookupValue != null?lookupValue.ToString() : string.Empty;
            }
            cellPrintElement.TextAlignment  = cellInfo.ColumnInfo.TextAlignment;
            cellPrintElement.StringTrimming = StringTrimming.EllipsisCharacter;
            if (this.GridView.RightToLeft == RightToLeft.Yes)
            {
                cellPrintElement.StringFormatFlags |= StringFormatFlags.DirectionRightToLeft;
            }
            if (!cellInfo.ColumnInfo.WrapText)
            {
                cellPrintElement.StringFormatFlags |= StringFormatFlags.NoWrap;
            }
            return(cellPrintElement);
        }
        private static void CreateFilterStringValues(
            FilterDescriptor descriptor,
            ref StringBuilder sb,
            GridViewComboBoxColumn lookupColumn)
        {
            if (descriptor is CompositeFilterDescriptor)
            {
                bool flag = false;
                CompositeFilterDescriptor filterDescriptor1 = (CompositeFilterDescriptor)descriptor;
                if (filterDescriptor1.NotOperator)
                {
                    sb.Append(LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider.GetLocalizedString("FilterCompositeNotOperator"));
                    sb.Append(" ");
                    flag = true;
                }
                foreach (FilterDescriptor filterDescriptor2 in (Collection <FilterDescriptor>)filterDescriptor1.FilterDescriptors)
                {
                    if (sb.Length > 0 && !flag)
                    {
                        string str = string.Empty;
                        switch (filterDescriptor1.LogicalOperator)
                        {
                        case FilterLogicalOperator.And:
                            str = LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider.GetLocalizedString("FilterLogicalOperatorAnd");

                            break;

                        case FilterLogicalOperator.Or:
                            str = LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider.GetLocalizedString("FilterLogicalOperatorOr");

                            break;
                        }
                        sb.Append(str);
                        sb.Append(' ');
                    }
                    flag = false;
                    GridFilterStringProvider.CreateFilterStringValues(filterDescriptor2, ref sb, lookupColumn);
                }
            }
            else
            {
                sb.Append(GridFilterStringProvider.GetLocalizedFilterOperator(descriptor.Operator));
                if (descriptor.Operator == FilterOperator.None || descriptor.Operator == FilterOperator.IsNull || descriptor.Operator == FilterOperator.IsNotNull)
                {
                    return;
                }
                sb.Append(": \"");
                if (lookupColumn == null)
                {
                    sb.Append(descriptor.Value);
                }
                else
                {
                    object lookupValue = descriptor.Value;
                    if (lookupColumn != null && lookupColumn.FilteringMode == GridViewFilteringMode.ValueMember)
                    {
                        lookupValue = lookupColumn.GetLookupValue(descriptor.Value);
                    }
                    if (lookupValue != null)
                    {
                        sb.Append(lookupValue);
                    }
                    else
                    {
                        sb.Append(descriptor.Value);
                    }
                }
                sb.Append("\" ");
            }
        }
 public static string GetFilterString(
     FilterDescriptor descriptor,
     GridViewComboBoxColumn lookupColumn)
 {
     return(GridFilterStringProvider.GetFilterString(descriptor, lookupColumn, 0));
 }