protected override GridViewColumn CreateColumnCore(GridView gridView, PropertyDisplayMetadata property, DynamicDataContext context)
        {
            var column = new GridViewCheckBoxColumn();

            column.SetBinding(GridViewCheckBoxColumn.ValueBindingProperty, context.CreateValueBinding(property.PropertyInfo.Name));
            return(column);
        }
Exemplo n.º 2
0
        public static GridViewDataColumn GenerateGridviewColumn(string fieldName, string header, bool readOnly, int width, GridViewColumnType columnType)
        {
            var columnw = new GridViewHyperlinkColumn();

            GridViewDataColumn column = null;

            if (columnType == GridViewColumnType.Text)
            {
                column = new GridViewTextBoxColumn();
            }
            else if (columnType == GridViewColumnType.Numeric)
            {
                column = new GridViewTextBoxColumn();
            }
            else if (columnType == GridViewColumnType.CheckBox)
            {
                column = new GridViewCheckBoxColumn();
                (column as GridViewCheckBoxColumn).ThreeState = true;
            }
            else if (columnType == GridViewColumnType.Command)
            {
                column = new GridViewCommandColumn();
            }
            else if (columnType == GridViewColumnType.Link)
            {
                column = new GridViewHyperlinkColumn();
            }
            column.Name       = fieldName;
            column.FieldName  = fieldName;
            column.HeaderText = header;
            column.ReadOnly   = readOnly;
            column.Width      = width;
            return(column);
        }
        private void FormatFaresGrid()
        {
            grdCompany.AllowAddNewRow = false;
            grdCompany.AllowEditRow   = true;
            GridViewTextBoxColumn col = new GridViewTextBoxColumn();

            col.Name      = COLS.Id;
            col.IsVisible = false;
            grdCompany.Columns.Add(col);

            GridViewCheckBoxColumn colcheck = new GridViewCheckBoxColumn();

            colcheck.HeaderText = "";
            colcheck.Name       = COLS.colcheck;
            grdCompany.Columns.Add(colcheck);
            col            = new GridViewTextBoxColumn();
            col.HeaderText = "Company Name";
            col.Name       = COLS.CompanyName;
            col.Width      = 300;
            col.ReadOnly   = true;
            grdCompany.Columns.Add(col);
            col           = new GridViewTextBoxColumn();
            col.Name      = COLS.RowNo;
            col.IsVisible = false;
            grdCompany.Columns.Add(col);
        }
Exemplo n.º 4
0
        private void InitializeTemplatesGrid()
        {
            GridViewTextBoxColumn col = new GridViewTextBoxColumn();

            col.HeaderText = "Template";
            col.Width      = 150;
            col.ReadOnly   = true;
            col.Name       = COLS_TEMPLATES.TEMPLATENAME;
            grdReportTemplates.Columns.Add(col);

            col           = new GridViewTextBoxColumn();
            col.IsVisible = false;
            col.Name      = COLS_TEMPLATES.TEMPLATEID;
            grdReportTemplates.Columns.Add(col);

            col           = new GridViewTextBoxColumn();
            col.IsVisible = false;
            col.Name      = COLS_TEMPLATES.FORMID;
            grdReportTemplates.Columns.Add(col);


            GridViewCheckBoxColumn colChk = new GridViewCheckBoxColumn();

            colChk.HeaderText = "Default";
            colChk.Name       = COLS_TEMPLATES.ISDEFAULT;
            grdReportTemplates.Columns.Add(colChk);
        }
Exemplo n.º 5
0
        private void AppendNewColumn(int column)
        {
            GridViewDataColumn newColumn = null;

            switch (column)
            {
            case 0:
                newColumn = new GridViewMaskBoxColumn {
                    Name = "", EnableExpressionEditor = true, Width = 50, HeaderText = ""
                };
                break;

            case 1:
                newColumn = new GridViewCheckBoxColumn
                {
                    Name = "Retracements",
                    EnableExpressionEditor = true,
                    Width      = 100,
                    HeaderText = Program.LanguageDefault.DictionarySettings["columnRetracements"]
                };
                break;

            case 2:
                newColumn = new GridViewCheckBoxColumn
                {
                    Name = "Projections",
                    EnableExpressionEditor = true,
                    Width      = 100,
                    HeaderText = Program.LanguageDefault.DictionarySettings["columnProjections"]
                };
                break;
            }

            grdFibonacci.Columns.Add(newColumn);
        }
Exemplo n.º 6
0
        private void FormatLocationGrid()
        {
            grdLocations.AllowAutoSizeColumns = true;
            grdLocations.AutoSizeColumnsMode  = GridViewAutoSizeColumnsMode.Fill;
            grdLocations.AllowAddNewRow       = false;
            grdLocations.ShowGroupPanel       = false;
            grdLocations.AutoCellFormatting   = true;
            grdLocations.ShowRowHeaderColumn  = false;
            grdLocations.EnableFiltering      = true;
            GridViewCheckBoxColumn cbcol = new GridViewCheckBoxColumn();

            cbcol.Name       = COLSD.Delete;
            cbcol.HeaderText = "";
            cbcol.Width      = 50;
            grdLocations.Columns.Add(cbcol);
            GridViewTextBoxColumn col = new GridViewTextBoxColumn();

            col.IsVisible = false;
            col.Name      = COLSD.Id;
            grdLocations.Columns.Add(col);

            col          = new GridViewTextBoxColumn();
            col.Width    = 220;
            col.Name     = COLSD.Address;
            col.ReadOnly = true;
            grdLocations.Columns.Add(col);

            col           = new GridViewTextBoxColumn();
            col.IsVisible = false;
            col.Name      = COLSD.HalfPostCode;
            grdLocations.Columns.Add(col);
        }
Exemplo n.º 7
0
        private void radGridView1_Click(object sender, EventArgs e)
        {
            var commandServer = new CommandServer();

            try
            {
                if (radGridViewSoc.CurrentRow.Cells[0].Value != null)
                {
                    _bindingSource_join = new BindingSource {
                        DataSource = commandServer.DataGridSet(@"select keys, fio as [ФИО], joi
                    from InspectorJoinSocView(" + radGridView1.CurrentRow.Cells[0].Value + ")").Tables[0]
                    };

                    radGridView2.DataSource = _bindingSource_join;

                    GridViewCheckBoxColumn date_join = new GridViewCheckBoxColumn("Привязка");
                    radGridView2.Columns[2] = date_join;
                    date_join.Name          = "date_j";
                    date_join.FieldName     = "joi";

                    radGridView2.Columns[0].IsVisible = false;
                    radGridView2.Columns[1].ReadOnly  = true;
                    radGridView2.AutoSizeColumnsMode  = GridViewAutoSizeColumnsMode.Fill;
                    radGridView2.Columns[1].BestFit();
                    radGridView2.Columns[2].BestFit();
                }
            }
            catch (Exception ex)
            {
                CommandClient commandClient = new CommandClient();
                commandClient.WriteFileError(ex, null);
            }
        }
Exemplo n.º 8
0
        private void refreshGrid()
        {
            radGridView1.Columns.Clear();
            var data = _repo.getColumns(_tableName);
            GridViewDataColumn colmn = null;

            foreach (var item in data)
            {
                var itemType = MetaDataSourceExtension.GetArtificialFieldType(item.FieldType, false);
                if (itemType == typeof(string))
                {
                    colmn = new GridViewTextBoxColumn();
                    colmn.TextAlignment = ContentAlignment.BottomLeft;
                    colmn.Width         = 50;
                }
                else if (itemType == typeof(bool))
                {
                    colmn = new GridViewCheckBoxColumn();
                    colmn.TextAlignment = ContentAlignment.MiddleCenter;
                    colmn.Width         = 50;
                }
                else
                {
                    colmn = new GridViewTextBoxColumn();
                    colmn.TextAlignment = ContentAlignment.MiddleCenter;
                    colmn.Width         = 50;
                }
                colmn.DataType   = itemType;
                colmn.Name       = item.Name;
                colmn.HeaderText = item.Name;
                colmn.FieldName  = item.Name;
                radGridView1.Columns.Add(colmn);
            }
        }
        public frmDriverCommisionTransactionExpensesReport3(IList LIST, DateTime from, DateTime till)
        {
            InitializeComponent();

            // IsCheck = val;
            this.Load += new EventHandler(frmInvoiceReport_Load);


            GridViewCheckBoxColumn col = new GridViewCheckBoxColumn();

            col.Width        = 40;
            col.AutoSizeMode = BestFitColumnMode.None;
            col.HeaderText   = "";
            col.Name         = "Check";
            grdDriverCommission.Columns.Add(col);

            grdDriverCommission.DataSource = LIST;


            this.Shown += new EventHandler(frmDriverCommisionTransactionExpensesReport2_Shown);



            lblCriteria.Text = "From : " + string.Format("{0:dd/MM/yyyy}", from) + " to " + string.Format("{0:dd/MM/yyyy}", till);
        }
Exemplo n.º 10
0
        private void InitializeFunctionsGrid()
        {
            GridViewCheckBoxColumn col = new GridViewCheckBoxColumn();

            col.HeaderText = "";
            col.Name       = "ColCheckAction";
            grdFunctions.Columns.Add(col);
        }
        private void FormatSurchargeRateGrid()
        {
            grdSurchargeRates.ShowGroupPanel = false;
            GridViewTextBoxColumn col = new GridViewTextBoxColumn();

            col.IsVisible = false;
            col.Name      = COL_SURCHARGERATES.ID;
            grdSurchargeRates.Columns.Add(col);


            col           = new GridViewTextBoxColumn();
            col.IsVisible = false;
            col.Name      = COL_SURCHARGERATES.POLICYID;
            grdSurchargeRates.Columns.Add(col);



            col            = new GridViewTextBoxColumn();
            col.HeaderText = COL_SURCHARGERATES.POSTCODE;
            col.Width      = 100;
            col.Name       = COL_SURCHARGERATES.POSTCODE;
            grdSurchargeRates.Columns.Add(col);

            GridViewCheckBoxColumn colChk = new GridViewCheckBoxColumn();

            colChk.HeaderText = "Amount Wise";
            colChk.Width      = 110;
            colChk.Name       = COL_SURCHARGERATES.AMOUNTWISE;
            grdSurchargeRates.Columns.Add(colChk);


            GridViewDecimalColumn col2 = new GridViewDecimalColumn();

            col2.HeaderText = "Percentage (%)";
            col2.Width      = 110;
            col2.Maximum    = 100;
            col2.Name       = COL_SURCHARGERATES.PERCENTAGE;
            grdSurchargeRates.Columns.Add(col2);


            col2            = new GridViewDecimalColumn();
            col2.HeaderText = "Amount (£)";
            col2.Width      = 110;
            col2.Maximum    = 100000;
            col2.Name       = COL_SURCHARGERATES.AMOUNT;
            grdSurchargeRates.Columns.Add(col2);



            UI.GridFunctions.AddDeleteColumn(grdSurchargeRates);

            grdSurchargeRates.ShowGroupPanel    = false;
            grdSurchargeRates.AddNewRowPosition = SystemRowPosition.Bottom;


            grdSurchargeRates.CellBeginEdit += new GridViewCellCancelEventHandler(grdSurchargeRates_CellBeginEdit);
            grdSurchargeRates.CellEndEdit   += GrdSurchargeRates_CellEndEdit;
        }
Exemplo n.º 12
0
        private void FormatServiceChargesGrid()
        {
            GridViewTextBoxColumn col = new GridViewTextBoxColumn();

            col.Name      = COLS.Id;
            col.IsVisible = false;
            grdServiceCharges.Columns.Add(col);


            GridViewCheckBoxColumn colcHK = new GridViewCheckBoxColumn();

            colcHK.Name       = COLS.Account;
            colcHK.HeaderText = "Account";
            colcHK.Width      = 70;
            grdServiceCharges.Columns.Add(colcHK);


            GridViewDecimalColumn dcol = new GridViewDecimalColumn();

            dcol.Name       = COLS.FromValue;
            dcol.HeaderText = "From";
            dcol.Width      = 90;
            grdServiceCharges.Columns.Add(dcol);

            dcol            = new GridViewDecimalColumn();
            dcol.Name       = COLS.ToValue;
            dcol.HeaderText = "Till";
            dcol.Width      = 90;
            grdServiceCharges.Columns.Add(dcol);

            dcol            = new GridViewDecimalColumn();
            dcol.Name       = COLS.ServiceChargePercent;
            dcol.HeaderText = "Service Charge Percent";
            dcol.Width      = 170;
            grdServiceCharges.Columns.Add(dcol);


            GridViewCheckBoxColumn cbcol = new GridViewCheckBoxColumn();

            cbcol.Name       = COLS.AmountWise;
            cbcol.HeaderText = "Amount Wise";
            cbcol.Width      = 120;
            grdServiceCharges.Columns.Add(cbcol);
            //grdServiceCharges.AddEditColumn();


            dcol            = new GridViewDecimalColumn();
            dcol.Name       = COLS.ServiceChargeAmount;
            dcol.HeaderText = "Service Charge Amount";
            dcol.Width      = 170;
            grdServiceCharges.Columns.Add(dcol);

            grdServiceCharges.AddDeleteColumn();

            grdServiceCharges.ShowRowHeaderColumn = false;
            //grdServiceCharges.Columns["btnEdit"].Width = 100;
            grdServiceCharges.Columns["btnDelete"].Width = 80;
        }
Exemplo n.º 13
0
        private void CreateCheckBoxColumn()
        {
            GridViewCheckBoxColumn col = new GridViewCheckBoxColumn();

            col.Width     = 30;
            col.Name      = "COLCheckBox";
            col.FieldName = "COLCheckBox";
            grdLister.Columns.Add(col);
        }
        public static GridViewBoundColumnBase GenerateGridviewColumn(string fieldName, string header, bool readOnly, int?width, GridViewColumnType columnType, IEnumerable itemsSource = null)
        {
            var columnw = new GridViewHyperlinkColumn();

            GridViewBoundColumnBase column = null;

            if (columnType == GridViewColumnType.Text)
            {
                column = new GridViewDataColumn();
            }
            else if (columnType == GridViewColumnType.Numeric)
            {
                column = new GridViewDataColumn();
                //column = new GridViewMaskedInputColumn();
                //(column as GridViewMaskedInputColumn).MaskType = MaskType.Numeric;
            }
            else if (columnType == GridViewColumnType.CheckBox)
            {
                column = new GridViewCheckBoxColumn();
                (column as GridViewCheckBoxColumn).IsThreeState = true;
            }
            else if (columnType == GridViewColumnType.Command)
            {
                // column = new GridViewCommandColumn();
            }
            else if (columnType == GridViewColumnType.Link)
            {
                column = new GridViewHyperlinkColumn();
            }
            else if (columnType == GridViewColumnType.Color)
            {
                column = new MyColorPickerColumn();
            }
            else if (columnType == GridViewColumnType.Enum)
            {
                column = new GridViewComboBoxColumn();
                (column as GridViewComboBoxColumn).ItemsSource = itemsSource;
            }
            else if (columnType == GridViewColumnType.ComboBox)
            {
                column = new GridViewComboBoxColumn();

                (column as GridViewComboBoxColumn).ItemsSource = itemsSource;
            }
            //column.Name = fieldName;
            //column.TextAlignment = System.Windows.TextAlignment.Center;
            column.UniqueName        = fieldName;
            column.DataMemberBinding = new System.Windows.Data.Binding(fieldName);
            column.Header            = header;
            column.IsReadOnly        = readOnly;
            if (width != null)
            {
                column.Width = width.Value;
            }
            return(column);
        }
Exemplo n.º 15
0
        private GridViewCheckBoxColumn CreateCheckBoxGridColumn(GridColumn col)
        {
            GridViewCheckBoxColumn newCol = new GridViewCheckBoxColumn();

            newCol.DataMemberBinding = new System.Windows.Data.Binding(col.BindingName);
            newCol.Header            = col.Header;
            newCol.UniqueName        = col.UniqueName;

            return(newCol);
        }
Exemplo n.º 16
0
        private GridViewDataColumn AppendNewColumn(string columnType, bool numberInTheHeader)
        {
            GridViewDataColumn newColumn = null;

            switch (columnType)
            {
            case "NumericText":
                newColumn = new GridViewMaskBoxColumn();
                ((GridViewMaskBoxColumn)newColumn).Mask = "f";
                newColumn.Name = "NumericText";
                newColumn.EnableExpressionEditor = true;
                break;

            case "Decimal":
                newColumn          = new GridViewDecimalColumn();
                newColumn.Name     = "Decimal";
                newColumn.DataType = typeof(Decimal);
                break;

            case "DateTime":
                newColumn          = new GridViewDateTimeColumn();
                newColumn.Name     = "DateTime";
                newColumn.DataType = typeof(DateTime);
                break;

            case "CheckBox":
                newColumn      = new GridViewCheckBoxColumn();
                newColumn.Name = "CheckBox";
                newColumn.EnableExpressionEditor = true;
                break;

            case "CustomExpression":
                newColumn = new GridViewDecimalColumn();
                newColumn.EnableExpressionEditor = true;
                newColumn.Name       = "CustomExpression";
                newColumn.HeaderText = "Custom Expression";
                newColumn.Width      = 80;
                break;
            }



            if (numberInTheHeader)
            {
                newColumn.HeaderText = (this.columnNum++).ToString() + " - " + columnType;
            }
            else
            {
                newColumn.HeaderText = columnType;
            }

            this.radGridView1.Columns.Add(newColumn);

            return(newColumn);
        }
        private void AddingCheckBoxColumn()
        {
            GridViewCheckBoxColumn colChk = new GridViewCheckBoxColumn();
            colChk.Name = "Check";
            colChk.HeaderText = "เลือก";
            gvPatient.Columns.Add(colChk);

            for (int i = 0; i < gvPatient.Rows.Count; i++)
            {
                gvPatient.Rows[i].Cells["colChk"].Value = false;
            }
        }
Exemplo n.º 18
0
        private void FormatShiftGrid()
        {
            grdDriverShift.AllowAddNewRow                     = false;
            grdDriverShift.AllowDeleteRow                     = false;
            grdDriverShift.ShowGroupPanel                     = false;
            grdDriverShift.TableElement.RowHeight             = 30;
            grdDriverShift.EnableFiltering                    = true;
            grdDriverShift.MasterTemplate.ShowRowHeaderColumn = false;
            GridViewCheckBoxColumn cbcol = new GridViewCheckBoxColumn();

            cbcol.Name     = COLS.Check;
            cbcol.ReadOnly = false;
            cbcol.Width    = 80;

            //cbcol.IsVisible = false;
            grdDriverShift.Columns.Add(cbcol);

            GridViewTextBoxColumn col = new GridViewTextBoxColumn();

            col.Name      = COLS.Id;
            col.IsVisible = false;
            grdDriverShift.Columns.Add(col);

            col           = new GridViewTextBoxColumn();
            col.Name      = COLS.DriverId;
            col.IsVisible = false;
            grdDriverShift.Columns.Add(col);

            col           = new GridViewTextBoxColumn();
            col.Name      = COLS.Driver_Shift_ID;
            col.IsVisible = false;
            grdDriverShift.Columns.Add(col);

            col           = new GridViewTextBoxColumn();
            col.Name      = COLS.Fleet_Driver_Shift_ID;
            col.IsVisible = false;
            grdDriverShift.Columns.Add(col);

            col            = new GridViewTextBoxColumn();
            col.Name       = COLS.DriverNo;
            col.HeaderText = "Driver No";
            col.Width      = 170;
            col.ReadOnly   = true;
            grdDriverShift.Columns.Add(col);

            col            = new GridViewTextBoxColumn();
            col.Name       = COLS.Driver;
            col.HeaderText = "Driver Name";
            col.Width      = 300;
            col.ReadOnly   = true;
            grdDriverShift.Columns.Add(col);
        }
Exemplo n.º 19
0
        private void ConfiguraGrilla()
        {
            RadGridViewDeposito.CurrentRowChanged -= new Telerik.WinControls.UI.CurrentRowChangedEventHandler(this.RadGridViewDepositos_CurrentRowChanged);

            RadGridViewDeposito.DataSource = new DataTable();
            RadGridViewDeposito.Columns.Clear();

            RadGridViewDeposito.EnableFiltering     = true;
            RadGridViewDeposito.AutoGenerateColumns = false;
            RadGridViewDeposito.AllowAddNewRow      = false;
            RadGridViewDeposito.MasterTemplate.ShowHeaderCellButtons = true;
            RadGridViewDeposito.MasterTemplate.ShowFilteringRow      = false;
            RadGridViewDeposito.TableElement.EndUpdate();
            RadGridViewDeposito.AllowDeleteRow      = false;
            RadGridViewDeposito.AllowRowResize      = false;
            RadGridViewDeposito.AllowEditRow        = true;
            RadGridViewDeposito.ShowRowHeaderColumn = false;
            RadGridViewDeposito.Select();
            RadGridViewDeposito.EnableSorting = true;

            List <int> data      = dttDeposito.AsEnumerable().Select(Nombre => Nombre.Field <int>("ValorDeposito").ToString().Length).ToList();
            int        WidthText = data.Max();
            var        col       = from dat in dttDeposito.AsEnumerable()
                                   where dat.Field <string>("ValorDeposito").Length == WidthText
                                   select dat;

            GridViewTextBoxColumn colValorDeposito = new GridViewTextBoxColumn();

            colValorDeposito.DataType     = typeof(decimal);
            colValorDeposito.FieldName    = "ValorDeposito";
            colValorDeposito.FormatString = "{0:C}";
            colValorDeposito.HeaderText   = "Valor de Deposito";
            colValorDeposito.MinWidth     = Consulta.AnchoTexto(WidthText > colValorDeposito.HeaderText.Length
                                            ? col.First().Field <int>("ValorDeposito").ToString()
                                            : colValorDeposito.HeaderText, RadGridViewDeposito.Font);
            colValorDeposito.Name     = "colValorDeposito";
            colValorDeposito.ReadOnly = true;
            RadGridViewDeposito.Columns.Add(colValorDeposito);

            GridViewCheckBoxColumn colActivo = new GridViewCheckBoxColumn();

            colActivo.FieldName  = "Activo";
            colActivo.HeaderText = "Activo";
            colActivo.MinWidth   = Consulta.AnchoTexto("Activo", RadGridViewDeposito.Font);
            colActivo.Name       = "colActivo";
            colActivo.ReadOnly   = true;
            RadGridViewDeposito.Columns.Add(colActivo);

            RadGridViewDeposito.CurrentRowChanged += new Telerik.WinControls.UI.CurrentRowChangedEventHandler(this.RadGridViewDepositos_CurrentRowChanged);

            RadGridViewDeposito.DataSource = dttDeposito;
        }
        private void FormatGrid()
        {
            grdPostCodes.AllowAutoSizeColumns = true;
            grdPostCodes.AutoSizeColumnsMode  = GridViewAutoSizeColumnsMode.Fill;
            grdPostCodes.AllowAddNewRow       = false;
            grdPostCodes.ShowGroupPanel       = false;
            grdPostCodes.AutoCellFormatting   = true;
            grdPostCodes.ShowRowHeaderColumn  = false;
            grdPostCodes.EnableFiltering      = true;



            GridViewTextBoxColumn col = new GridViewTextBoxColumn();

            col.IsVisible = false;
            col.Name      = COLS.Id;
            grdPostCodes.Columns.Add(col);


            GridViewCheckBoxColumn cbcol = new GridViewCheckBoxColumn();

            cbcol.Name  = COLS.Check;
            cbcol.Width = 50;
            grdPostCodes.Columns.Add(cbcol);
            col            = new GridViewTextBoxColumn();
            col.HeaderText = "PostCode";
            col.Name       = COLS.PostCode;
            col.Width      = 80;
            col.ReadOnly   = true;

            grdPostCodes.Columns.Add(col);
            col            = new GridViewTextBoxColumn();
            col.HeaderText = "Area Name";
            col.Name       = COLS.AreaName;
            col.Width      = 110;
            col.ReadOnly   = true;
            grdPostCodes.Columns.Add(col);

            grdPostCodes.CommandCellClick += new CommandCellClickEventHandler(grdPostCodes_CommandCellClick);
            // UI.GridFunctions.AddDeleteColumn(grdPostCodes);
            //GridViewCommandColumn cmdcol = new GridViewCommandColumn();
            //cmdcol.Width = 70;

            //cmdcol.Name = "coldelete";
            //cmdcol.UseDefaultText = true;
            //cmdcol.ImageLayout = System.Windows.Forms.ImageLayout.Center;
            //cmdcol.DefaultText = "Delete";
            //cmdcol.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;

            //grdPostCodes.Columns.Add(cmdcol);
        }
Exemplo n.º 21
0
        private void ButtonSave_Click2(object sender, EventArgs e)
        {
            if (digit == 1)
            {
                twoDownView.Width           -= 500;
                twoDownView.radPanel1.Width -= 480;
                twoDownView.radPanel2.Width -= 480;
                buttonSave.Text              = "Добавить";
                digit = 0;
                twoDownView.closePanel.Location = new Point(twoDownView.closePanel.Location.X - 480, 12);
                return;
            }
            twoDownView.Width           += 500;
            twoDownView.radPanel1.Width += 480;
            twoDownView.radPanel2.Width += 480;
            addTeachers addTeachers = new addTeachers(twoDownView.radGridView2, twoDownView.radBindingNavigator1);

            twoDownView.radPanel2.Controls.Add(addTeachers);
            addTeachers.Location            = new Point(625, 12);
            twoDownView.closePanel.Location = new Point(twoDownView.closePanel.Location.X + 480, 12);

            GridViewCheckBoxColumn checkBoxColumn = new GridViewCheckBoxColumn();

            checkBoxColumn.DataType   = typeof(int);
            checkBoxColumn.Name       = "check";
            checkBoxColumn.FieldName  = "Да/Нет";
            checkBoxColumn.HeaderText = "Да/Нет";

            GridViewTextBoxColumn gridViewTextBoxColumn = new GridViewTextBoxColumn();

            gridViewTextBoxColumn.Name       = "dis";
            gridViewTextBoxColumn.HeaderText = "Наименование дисциплины";

            addTeachers.radGridView2.MasterTemplate.Columns.Add(checkBoxColumn);
            addTeachers.radGridView2.MasterTemplate.Columns.Add(gridViewTextBoxColumn);

            addTeachers.radGridView2.Rows.Add(false, "Русский язык");
            addTeachers.radGridView2.Columns[0].Width      = 70;
            addTeachers.radGridView2.Columns[1].HeaderText = "Наименование дисциплины";
            addTeachers.radGridView2.Columns[1].Width      = 320;



            addTeachers.radDropDownList1.DataSource    = employeeBindingSource;
            addTeachers.radDropDownList1.DisplayMember = "FIO";
            addTeachers.radDropDownList1.ValueMember   = "FIO";

            buttonSave.Text = "Закрыть";
            digit           = 1;
        }
Exemplo n.º 22
0
        private void BindGrid()
        {
            try
            {
                if (InfSearchDatatable != null && InfSearchDatatable.DefaultView.Count > 0)
                {
                    BsSearch.DataSource = InfSearchDatatable.DefaultView;
                    //
                    grdSearch.AutoGenerateColumns = false;


                    string[] GridColCaption = InfGridFieldCaption.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                    string[] GridColName    = InfGridFieldName.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                    string[] GridColSize    = InfGridFieldSize.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

                    GridViewCheckBoxColumn gcColChk = new GridViewCheckBoxColumn();
                    gcColChk.Name       = "lSelect".Trim();
                    gcColChk.FieldName  = "lSelect".Trim();
                    gcColChk.HeaderText = "[ ]";
                    gcColChk.Width      = 30;
                    gcColChk.IsVisible  = _infMultiSelect;
                    grdSearch.Columns.Add(gcColChk);


                    for (int i = 0; i <= GridColName.Length - 1; i++)
                    {
                        GridViewTextBoxColumn gcCol            = new GridViewTextBoxColumn();
                        GridViewTextBoxColumn dataGridViewCell = new GridViewTextBoxColumn();
                        gcCol.Name       = GridColName[i].Trim();
                        gcCol.HeaderText = GridColCaption[i].Trim();
                        gcCol.Width      = Convert.ToInt32(GridColSize[i].Trim());
                        gcCol.FieldName  = GridColName[i].Trim();
                        //gcCol.CellTemplate = dataGridViewCell;
                        gcCol.ReadOnly = true;
                        if (Convert.ToInt32(GridColSize[i].Trim()) == 0)
                        {
                            gcCol.IsVisible = false;
                        }
                        grdSearch.Columns.Add(gcCol);
                    }
                    grdSearch.DataSource = BsSearch;
                }
            }
            catch (Exception ex)
            {
                ClsMessage._IClsMessage.ProjectExceptionMessage(ex);
            }
        }
        public frmDriverRentTransactionExpensesReport(IList LIST, DateTime from, DateTime till)
        {
            InitializeComponent();

            // IsCheck = val;
            //  this.Load += new EventHandler(frmInvoiceReport_Load);


            GridViewCheckBoxColumn col = new GridViewCheckBoxColumn();

            col.Width        = 40;
            col.AutoSizeMode = BestFitColumnMode.None;
            col.HeaderText   = "";
            col.Name         = "Check";
            grdLister.Columns.Add(col);

            grdLister.DataSource = LIST;


            this.Shown += new EventHandler(frmDriverRentTransactionExpensesReport_Shown);

            btnPrev.Click         += new EventHandler(btnPrev_Click);
            btnNext.Click         += new EventHandler(btnNext_Click);
            btnEmailCurrent.Click += new EventHandler(btnEmailCurrent_Click);
            btnPrintCurrent.Click += new EventHandler(btnPrintCurrent_Click);
            btnPrintAll.Click     += new EventHandler(btnPrintAll_Click);

            btnEmailAll.Click         += new EventHandler(btnEmailAll_Click);
            grdLister.CellDoubleClick += new GridViewCellEventHandler(grdLister_CellDoubleClick);

            cbAllDrivers.CheckedChanged += new EventHandler(cbAllDrivers_CheckedChanged);


            if (from != till)
            {
                lblCriteria.Text = "From : " + string.Format("{0:dd/MM/yyyy}", from) + " to " + string.Format("{0:dd/MM/yyyy}", till);
            }



            //ComboFunctions.FillSubCompanyCombo(ddlSubCompany);

            //if (ddlSubCompany.Items.Count > 1)
            //    ddlSubCompany.SelectedIndex = 1;
            //else
            //    ddlSubCompany.SelectedIndex = 0;
        }
Exemplo n.º 24
0
 public void SetRadViewColumnCheckCAN2(AgreementType agreementType)
 {
     if (agreementType == AgreementType.CCP || agreementType == AgreementType.XCP)
     {
         if (_10msCan2 == null)
         {
             _10msCan2            = new GridViewCheckBoxColumn();
             _10msCan2.DataType   = typeof(int);
             _10msCan2.Name       = "_10ms";
             _10msCan2.FieldName  = "_10ms";
             _10msCan2.HeaderText = "10ms";
             gridViewCan2.MasterTemplate.Columns.Add(_10msCan2);
             //gridView.Columns[13].BestFit();
         }
         if (_100msCan2 == null)
         {
             _100msCan2            = new GridViewCheckBoxColumn();
             _100msCan2.DataType   = typeof(int);
             _100msCan2.Name       = "_100ms";
             _100msCan2.FieldName  = "_100ms";
             _100msCan2.HeaderText = "100ms";
             gridViewCan2.MasterTemplate.Columns.Add(_100msCan2);
             //gridView.Columns[14].BestFit();
         }
         foreach (GridViewDataRowInfo row in this.gridViewCan2.Rows)
         {
             row.Cells[12].Value = 0;
             row.Cells[13].Value = 0;
         }
     }
     else if (agreementType == AgreementType.DBC)
     {
         if (_dbcSelectCan2 == null)
         {
             _dbcSelectCan2            = new GridViewCheckBoxColumn();
             _dbcSelectCan2.DataType   = typeof(int);
             _dbcSelectCan2.Name       = "_dbcSelectCan2";
             _dbcSelectCan2.FieldName  = "_dbcSelectCan2";
             _dbcSelectCan2.HeaderText = "选择";
             gridViewCan2.MasterTemplate.Columns.Add(_dbcSelectCan2);
         }
         foreach (GridViewDataRowInfo row in this.gridViewCan2.Rows)
         {
             row.Cells[12].Value = 0;
         }
     }
 }
Exemplo n.º 25
0
        public frmJobClearingUtil()
        {
            InitializeComponent();
            this.Load += new EventHandler(frmJobClearingUtil_Load);



            grdLister.ShowRowHeaderColumn = false;
            lblHeading.Text = "These jobs were expired before " + AppVars.objPolicyConfiguration.ExpiredPDAJobHours.ToInt()
                              + " Hour(s) and not Cleared for some reason..";

            GridViewCheckBoxColumn col = new GridViewCheckBoxColumn();

            col.Name       = "colChk";
            col.HeaderText = "";
            col.Width      = 60;
            grdLister.Columns.Add(col);
        }
        private void FormatFaresGrid()
        {
            grdCompany.AllowAddNewRow = false;
            grdCompany.AllowEditRow   = true;
            GridViewTextBoxColumn col = new GridViewTextBoxColumn();

            col.Name      = COLS.Id;
            col.IsVisible = false;
            grdCompany.Columns.Add(col);

            GridViewCheckBoxColumn colcheck = new GridViewCheckBoxColumn();

            colcheck.HeaderText = "";
            colcheck.Name       = COLS.colcheck;
            grdCompany.Columns.Add(colcheck);
            col            = new GridViewTextBoxColumn();
            col.HeaderText = "Company Name";
            col.Name       = COLS.CompanyName;
            col.Width      = 160;
            col.ReadOnly   = true;
            grdCompany.Columns.Add(col);
            col           = new GridViewTextBoxColumn();
            col.Name      = COLS.RowNo;
            col.IsVisible = false;
            grdCompany.Columns.Add(col);
            colcheck            = new GridViewCheckBoxColumn();
            colcheck.HeaderText = "Mileage Settings";
            colcheck.Name       = COLS.MileageSettings;
            colcheck.Width      = 138;
            grdCompany.Columns.Add(colcheck);
            colcheck            = new GridViewCheckBoxColumn();
            colcheck.HeaderText = "Fixed Fares";
            colcheck.Width      = 108;
            colcheck.Name       = COLS.FixedFares;
            grdCompany.Columns.Add(colcheck);
            //colcheck = new GridViewCheckBoxColumn();
            //colcheck.HeaderText = "All";
            //colcheck.Width = 50;
            //colcheck.Name = COLS.All;
            //grdCompany.Columns.Add(colcheck);
        }
        private void FormatGrid()
        {
            GridViewCheckBoxColumn col = new GridViewCheckBoxColumn();

            col.Width        = 60;
            col.AutoSizeMode = BestFitColumnMode.None;
            col.HeaderText   = "";
            col.Name         = "Check";
            grdLister.Columns.Add(col);
            GridViewTextBoxColumn tcol = new GridViewTextBoxColumn();

            tcol.Name      = COLS.Id;
            tcol.IsVisible = false;
            grdLister.Columns.Add(tcol);
            tcol            = new GridViewTextBoxColumn();
            tcol.Name       = COLS.VehicleType;
            tcol.HeaderText = "Vehicle Type";;
            tcol.Width      = 140;
            tcol.ReadOnly   = true;
            grdLister.Columns.Add(tcol);
        }
Exemplo n.º 28
0
        private void InitRequestGridView()
        {
            requestListGridView = new RadGridView();
            GridViewCheckBoxColumn chkcolumn = new GridViewCheckBoxColumn("SelectedItem");

            requestListGridView.Columns.Add(chkcolumn);
            GridViewTextBoxColumn column = new GridViewTextBoxColumn("Code");

            requestListGridView.Columns.Add(column);
            column = new GridViewTextBoxColumn("Date");
            column.FormatString = "{0:dd/MM/yyyy}";
            requestListGridView.Columns.Add(column);
            column = new GridViewTextBoxColumn("Notes");
            requestListGridView.Columns.Add(column);
            requestListGridView.DataSource  = dbContext.EQ_Requests.ToList <EQ_Requests>();
            requestListGridView.Width       = 200;
            requestListGridView.Height      = 300;
            requestListGridView.Left        = this.Left;
            requestListGridView.Top         = this.Bottom;
            requestListGridView.Visible     = true;
            requestListGridView.MultiSelect = true;
        }
        private void FormatPaymentTypeGrid()
        {
            grdPaymentTypes.AllowEditRow = true;
            GridViewTextBoxColumn col = new GridViewTextBoxColumn();

            col.Name      = COLSP.Id;
            col.IsVisible = false;
            grdPaymentTypes.Columns.Add(col);
            col            = new GridViewTextBoxColumn();
            col.Name       = COLSP.PaymentType;
            col.HeaderText = "Payment Type";
            col.Width      = 100;
            col.ReadOnly   = true;

            grdPaymentTypes.Columns.Add(col);
            GridViewCheckBoxColumn cbcol = new GridViewCheckBoxColumn();

            cbcol.Name   = COLSP.Check;
            col.ReadOnly = false;
            cbcol.Width  = 40;
            grdPaymentTypes.Columns.Add(cbcol);
        }
Exemplo n.º 30
0
 public static void initializeRadgridCell(ref RadGridView _radgrid, string _tableName)
 {
     Telerik.WinControls.UI.GridViewTextBoxColumn cell;
     Telerik.WinControls.UI.GridViewCheckBoxColumn cellCb;
     var schema = getTableSchema(_tableName);
     foreach (DataRow row in schema.Rows)
     {
         if (!IsCheckboxCellType(row["COLUMN_NAME"].ToString().ToUpper()))
         {
             cellCb = new GridViewCheckBoxColumn();
             cellCb.Name = row["COLUMN_NAME"].ToString();
             cellCb.FieldName = row["COLUMN_NAME"].ToString();
             cellCb.HeaderText = row["COLUMN_DESCRIPTION"].ToString();
             cellCb.IsVisible = true;
             cellCb.ReadOnly = true;
             cellCb.DataType = typeOf(row["DATA_TYPE"].ToString());
             cellCb.ThreeState = false;
             cellCb.BestFit();
             _radgrid.MasterTemplate.Columns.Add(cellCb);
         }
         else
         {
             cell = new GridViewTextBoxColumn();
             cell.Name = row["COLUMN_NAME"].ToString();
             cell.FieldName = row["COLUMN_NAME"].ToString();
             cell.HeaderText = row["COLUMN_DESCRIPTION"].ToString();
             cell.IsVisible = true;
             cell.ReadOnly = true;
             cell.DataType = typeOf(row["DATA_TYPE"].ToString());//getType(row["DATA_TYPE"].ToString());
             //cell.FormatString = (cell.DataType == typeof(decimal)) ? "{0:N2}" : (cell.DataType == typeof(DateTime) && row["COLUMN_NAME"].ToString() == "") ? "{0:dd/MM/yyyy}" : "{0}";
             cell.FormatString = getCellFormatString(cell.DataType, cell.FieldName);
             cell.BestFit();
             _radgrid.MasterTemplate.Columns.Add(cell);
         }
     }
     //return _radgrid;
 }
        public static GridViewBoundColumnBase GenerateGridviewColumn(string fieldName, string header, bool readOnly, int width, GridViewColumnType columnType)
        {
            var columnw = new GridViewHyperlinkColumn();

            GridViewBoundColumnBase column = null;

            if (columnType == GridViewColumnType.Text)
            {
                column = new GridViewDataColumn();
            }
            else if (columnType == GridViewColumnType.Numeric)
            {
                column = new GridViewDataColumn();
            }
            else if (columnType == GridViewColumnType.CheckBox)
            {
                column = new GridViewCheckBoxColumn();
                (column as GridViewCheckBoxColumn).IsThreeState = true;
            }
            else if (columnType == GridViewColumnType.Command)
            {
                // column = new GridViewCommandColumn();
            }
            else if (columnType == GridViewColumnType.Link)
            {
                column = new GridViewHyperlinkColumn();
            }
            //column.Name = fieldName;
            //column.TextAlignment = System.Windows.TextAlignment.Center;

            column.DataMemberBinding = new System.Windows.Data.Binding(fieldName);
            column.Header            = header;
            column.IsReadOnly        = readOnly;
            column.Width             = width;
            return(column);
        }
Exemplo n.º 32
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;

                GridViewCheckBoxColumn checkboxColum;
                checkboxColum            = new GridViewCheckBoxColumn();
                checkboxColum.Name       = "Seleccionar";
                checkboxColum.HeaderText = "Seleccionar";
                checkboxColum.FieldName  = "Seleccionar";
                this.grdItems.Columns.Add(checkboxColum);
                this.grdItems.Columns["Seleccionar"].Width    = 90;
                this.grdItems.Columns["Seleccionar"].ReadOnly = false;

                this.grdItems.Columns.Add("NVIA_Codigo", "Código", "NVIA_Codigo");
                this.grdItems.Columns.Add("NAVE_Nombre", "NAVE", "NAVE_Nombre");
                this.grdItems.Columns.Add("NVIA_NroViaje", "NroViaje", "NVIA_NroViaje");
                this.grdItems.Columns.Add("NVIA_FecETA_IMPO_ETD_EXPO", "Fecha ETA/ETD", "NVIA_FecETA_IMPO_ETD_EXPO");
                this.grdItems.Columns.Add("NVIA_FecPreFactura", "Fecha Pre-Factura", "NVIA_FecPreFactura");

                this.grdItems.Columns.Add("AsientoContable", "Nro. Asiento", "AsientoContable");
                this.grdItems.Columns.Add("CONS_DescRGM", "Régimen", "CONS_DescRGM");
                this.grdItems.Columns.Add("CONS_DescVIA", "Via", "CONS_DescVIA");
                this.grdItems.Columns.Add("ENTC_NomTransp", "Transportista", "ENTC_NomTransp");
                this.grdItems.Columns.Add("DocsMandato", "Doc. Mandato", "DocsMandato");
                this.grdItems.Columns.Add("NVIA_DesEstado", "Estado", "NVIA_DesEstado");

                this.grdItems.Columns["NVIA_Codigo"].ReadOnly   = true;
                this.grdItems.Columns["NAVE_Nombre"].ReadOnly   = true;
                this.grdItems.Columns["NVIA_NroViaje"].ReadOnly = true;

                this.grdItems.Columns["NVIA_FecETA_IMPO_ETD_EXPO"].ReadOnly     = true;
                this.grdItems.Columns["NVIA_FecETA_IMPO_ETD_EXPO"].FormatString = "{0:dd/MM/yyyy}";
                this.grdItems.Columns["NVIA_FecPreFactura"].ReadOnly            = true;
                this.grdItems.Columns["NVIA_FecPreFactura"].FormatString        = "{0:dd/MM/yyyy}";

                this.grdItems.Columns["AsientoContable"].ReadOnly = true;
                this.grdItems.Columns["AsientoContable"].ReadOnly = true;
                this.grdItems.Columns["CONS_DescRGM"].ReadOnly    = true;
                this.grdItems.Columns["CONS_DescVIA"].ReadOnly    = true;
                this.grdItems.Columns["ENTC_NomTransp"].ReadOnly  = true;
                this.grdItems.Columns["DocsMandato"].ReadOnly     = true;

                grdItems.BestFitColumns();

                grdItems.SelectionMode    = Telerik.WinControls.UI.GridViewSelectionMode.FullRowSelect;
                grdItems.MultiSelect      = true;
                grdItems.ReadOnly         = false;
                grdItems.ShowFilteringRow = false;
                grdItems.EnableFiltering  = false;
                grdItems.MasterTemplate.EnableFiltering = false;
                grdItems.EnableGrouping = false;
                grdItems.MasterTemplate.EnableGrouping = false;
                grdItems.EnableSorting = false;
                grdItems.MasterTemplate.EnableCustomSorting = false;
                grdItems.AutoGenerateColumns          = false;
                grdItems.AllowCellContextMenu         = false;
                grdItems.AllowColumnHeaderContextMenu = false;
            }
            catch (Exception ex)
            { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Presenter.Title, Infrastructure.Aspect.Constants.Mensajes.FormatDataGridView, ex); }
        }
Exemplo n.º 33
0
        /// <summary>
        /// Inits the grid param def.
        /// </summary>
        private void InitGridParamDef()
        {
            this.gvParameterDefinition.Columns.Clear();
            this.gvParameterDefinition.AllowEditRow = true;

            var colId = new GridViewTextBoxColumn() { DataType = typeof(int), Name = "Id", FieldName = "Id", HeaderText = "Id", Width = 20, ReadOnly = true };
            this.gvParameterDefinition.MasterTemplate.Columns.Add(colId);

            var colActive = new GridViewCheckBoxColumn() { DataType = typeof(bool), Name = "IsActive", FieldName = "IsActive", HeaderText = "Bearbeiten", Width = 30, ReadOnly = false };
            this.gvParameterDefinition.MasterTemplate.Columns.Add(colActive);

            var colParamName = new GridViewTextBoxColumn() { DataType = typeof(string), Name = "Parametername", FieldName = "Name", HeaderText = "Parametername", MinWidth = 80, ReadOnly = true };
            this.gvParameterDefinition.MasterTemplate.Columns.Add(colParamName);

            var colParamObis = new GridViewTextBoxColumn() { DataType = typeof(string), Name = "Obis", FieldName = "ObisCode", HeaderText = "Obis", Width = 50, ReadOnly = true };
            this.gvParameterDefinition.MasterTemplate.Columns.Add(colParamObis);

            var colValName = new GridViewMaskBoxColumn() { DataType = typeof(string), Name = "Sollwert", FieldName = "TargetValue", HeaderText = "Sollwert", MinWidth = 80, ReadOnly = false };
            colValName.MaskType = MaskType.Standard;
            colValName.Mask = "?";
            this.gvParameterDefinition.MasterTemplate.Columns.Add(colValName);

            var colAutoIncrement = new GridViewCheckBoxColumn() { DataType = typeof(bool), Name = "Hochzählen", FieldName = "IsAutoIncrement", HeaderText = "Hochzählen", Width = 30, ReadOnly = false };
            this.gvParameterDefinition.MasterTemplate.Columns.Add(colAutoIncrement);
        }
Exemplo n.º 34
0
        /// <summary>
        /// Inits the grid param status.
        /// </summary>
        private void InitGridParamStatus()
        {
            this.gvParameterStatus.Columns.Clear();
            //this.gvParameterStatus.AllowEditRow = false;

            var colId = new GridViewTextBoxColumn() { DataType = typeof(int), Name = "Id", FieldName = "Id", HeaderText = "Id", Width = 10, ReadOnly = true };
            this.gvParameterStatus.MasterTemplate.Columns.Add(colId);

            var colActive = new GridViewCheckBoxColumn() { DataType = typeof(bool), Name = "IsActive", FieldName = "IsActive", HeaderText = "Bearbeiten", Width = 10 };
            this.gvParameterStatus.MasterTemplate.Columns.Add(colActive);

            var colParamName = new GridViewTextBoxColumn() { DataType = typeof(string), Name = "Parametername", FieldName = "Name", HeaderText = "Parametername", MinWidth = 80, ReadOnly = true };
            this.gvParameterStatus.MasterTemplate.Columns.Add(colParamName);

            var colParamObis = new GridViewTextBoxColumn() { DataType = typeof(string), Name = "Obis", FieldName = "ObisCode", HeaderText = "Obis", Width = 30, ReadOnly = true };
            this.gvParameterStatus.MasterTemplate.Columns.Add(colParamObis);

            var colTargetValName = new GridViewTextBoxColumn() { DataType = typeof(string), Name = "Sollwert", FieldName = "TargetValue", HeaderText = "Sollwert", MinWidth = 80, ReadOnly = true };
            this.gvParameterStatus.MasterTemplate.Columns.Add(colTargetValName);

            var colRealValName = new GridViewTextBoxColumn() { DataType = typeof(string), Name = "Istwert", FieldName = "RealValue", HeaderText = "Istwert", MinWidth = 80, ReadOnly = true };
            this.gvParameterStatus.MasterTemplate.Columns.Add(colRealValName);

            var colIsWritten = new GridViewCheckBoxColumn() { DataType = typeof(bool), Name = "Schreibstatus", FieldName = "IsWritten", HeaderText = "Schreibstatus", MinWidth = 10, ReadOnly = true };
            this.gvParameterStatus.MasterTemplate.Columns.Add(colIsWritten);

            var colIsValid = new GridViewCheckBoxColumn() { DataType = typeof(bool), Name = "IsValid", FieldName = "IsReadBackValid", HeaderText = "Prüfstatus", MinWidth = 10, ReadOnly = true };
            this.gvParameterStatus.MasterTemplate.Columns.Add(colIsValid);
        }