Exemplo n.º 1
0
        public Form1(string[] args)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Ryder25;
            LNG = new DataSet("language");
            fRF = new FindAndReplaceForm(this.lngDataGridView);
            filePath = openFileDialog.FileName;
            lngDataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            lngDataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;
            lngDataGridView.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            lngDataGridView.AllowUserToAddRows = false;
            lngDataGridView.AlternatingRowsDefaultCellStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#E8EDFF");
            DgvFilterManager dgvfm = new DgvFilterManager(lngDataGridView);
            // Open With
            if (args.Length > 0) {
                if (File.Exists(args[0]) == true) {
                    filePath = args[0];
                    Stream s = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
                    lngFile = new LngFile(s);
                    lngDataGridView.DataSource = lngFile.GetDataTable();

                    this.Text = "Ego Language Editor - " + filePath;
                }
            }
        }
 public FormSAPDataTable()
 {
     InitializeComponent();
     DgvFilterManager fm = new DgvFilterManager();
     fm.ColumnFilterAdding += fm_ColumnFilterAdding;
     fm.DataGridView = dataGridView1;
     this.Shown += FormSAPDataTable_Shown;
 }
Exemplo n.º 3
0
        private void Fill()
        {
            CWCarsLogic cars = new CWCarsLogic(manager);
            DataGV.AutoGenerateColumns = false;

            ListToDataTable listToDataTable = new ListToDataTable();
            DataGV.DataSource = listToDataTable.ToDataTable<CWCarView>(cars.GetAllView().ToList());
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);
        }
        public FormReadTable()
        {
            InitializeComponent();
            this.readTableControl1.EventMessage += readTableControl1_EventMessage;
            this.readTableControl1.EventGetTable += readTableControl1_EventGetTable;

            DgvFilterManager fm = new DgvFilterManager();
            fm.ColumnFilterAdding += fm_ColumnFilterAdding;
            fm.DataGridView = dataGridView1;

            this.textboxLog.KeyDown += textboxLog_KeyDown;
        }
        private void Sample5_Load(object sender, EventArgs e)
        {
            // Use this static property to set your culture-specific months naming. Default is full-named english months
            DgvMonthYearColumnFilter.MonthCsvList =  "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec";

            DgvFilterManager fm = new DgvFilterManager(dataGridView1);
            InitGrid();
            fm["CustomerId"] = new CustomizedColumnFilter();
            fm["RequiredDate"] = new DgvDateRangeColumnFilter();
            fm["OrderId"] = new DgvNumRangeColumnFilter();
            fm["OrderDate"] = new DgvMonthYearColumnFilter();
            ((DgvMonthYearColumnFilter)fm["OrderDate"]).YearMin = 2007;
        }
Exemplo n.º 6
0
        public ImportNrcsSnotel()
        {
            InitializeComponent();

            filterManager = new DgvFilterManager();

            var tbl = NrcsSnotelSeries.SnotelSites;
            dataGridView1.DataSource = null;
            this.dataGridView1.DataSource = tbl;
            this.dataGridView1.SelectionChanged += new EventHandler(dataGridView1_SelectionChanged);
            dataGridView1.DataError += dataGridView1_DataError;
            filterManager.DataGridView = dataGridView1;
            buttonOk.Enabled = false;
        }
        private void Sample3_Load(object sender, EventArgs e)
        {
            InitGrid();
            DgvFilterManager fm = new DgvFilterManager();

            // Using the ColumnFilterAdding event, you may force your preferred filter,
            // BEFORE the FilterManager create the predefined filter. This event is
            // raised for each column in the grid when you set the DataGridView property
            // of the FilterManager.
            fm.ColumnFilterAdding += new ColumnFilterEventHandler(fm_ColumnFilterAdding);

            fm.DataGridView = dataGridView1; // this raises ColumnFilterAdding events

            // After column filters creation however, you can overwrite the created filter.
            fm["CustomerID"] = new DgvComboBoxColumnFilter();
        }
Exemplo n.º 8
0
        /// <summary>
        /// Called by the <i>filter manager</i>, inits the <i>column filter</i> and raises the FilterInitializing event.
        /// </summary>
        /// <param name="FilterManager">The <i>filter manager</i>.</param>
        /// <param name="FilterHost">The filter host.</param>
        /// <param name="gridColumn">The DataGridView column.</param>
        /// <param name="boundDataView">The bound data view.</param>
        public void Init(DgvFilterManager FilterManager, DgvBaseFilterHost FilterHost, DataGridViewColumn gridColumn, DataView boundDataView)
        {
            this.mFilterManager      = FilterManager;
            this.mFilterHost         = FilterHost;
            this.mDataGridViewColumn = gridColumn;
            this.mBoundDataView      = boundDataView;
            this.mOriginalDataGridViewColumnHeaderText = gridColumn.HeaderText;
            if (gridColumn.DataPropertyName != "")
            {
                this.mColumnDataType = boundDataView.Table.Columns[gridColumn.DataPropertyName].DataType;
            }
            else
            {
                this.mColumnDataType = typeof(string);
            }
            FilterHost.FilterClientArea.Controls.Add(this);
            FilterHost.Location = new System.Drawing.Point(0, 0);
            this.Visible        = false;
            CancelEventArgs e = new CancelEventArgs(false);

            OnFilterInitializing(this, e);
        }
Exemplo n.º 9
0
        private void OpenTable(string tableName)
        {
            // Display New Tab
            if (tabControl.TabPages.ContainsKey(tableName) == true || tableListBox.SelectedIndex == -1) {
                tabControl.SelectedTab = tabControl.TabPages[tableName];
                return;
            }
            TabPage tp = new TabPage(tableName);
            tp.Name = tableName;

            DataGridView dgv = new DataGridView();
            dgv.Dock = DockStyle.Fill;
            dgv.AlternatingRowsDefaultCellStyle.BackColor = ColorTranslator.FromHtml("#E8EDFF");//#E0E0E0
            dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
            dgv.AllowUserToAddRows = false;
            dgv.KeyDown += new KeyEventHandler(dgv_KeyDown);
            dgv.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(dgv_DataBindingComplete);
            dgv.DataError += new DataGridViewDataErrorEventHandler(dgv_DataError);
            //dgv.CellDoubleClick += new DataGridViewCellEventHandler(dgv_CellDoubleClick);
            dgv.CellMouseDown += new DataGridViewCellMouseEventHandler(dgv_CellMouseDown);
            dgv.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(dgv_ColumnHeaderMouseClick);
            dgv.MouseEnter += dgv_MouseEnter;
            dgv.DataSource = dbFile.Tables[tableName];
            DataGridViewColumnSelector dgvcs = new DataGridViewColumnSelector(dgv);
            DgvFilterManager dgvfm = new DgvFilterManager(dgv);

            tp.Controls.Add(dgv);
            tabControl.TabPages.Add(tp);
            foreach (DataColumn col in dbFile.Tables[tableName].Columns) {
                if (col.DataType == typeof(string)) {
                    if (dgv.Columns[col.ColumnName] is DataGridViewTextBoxColumn && col.MaxLength >= 0) {
                        ((DataGridViewTextBoxColumn)dgv.Columns[col.ColumnName]).MaxInputLength = col.MaxLength;
                    }
                }
            }
            tabControl.SelectedIndex = tabControl.TabPages.Count - 1;
            //tabControl.Focus();
        }
Exemplo n.º 10
0
 /// <summary>
 /// Called by the <i>filter manager</i>, inits the <i>column filter</i> and raises the FilterInitializing event.
 /// </summary>
 /// <param name="FilterManager">The <i>filter manager</i>.</param>
 /// <param name="FilterHost">The filter host.</param>
 /// <param name="gridColumn">The DataGridView column.</param>
 /// <param name="boundDataView">The bound data view.</param>
 public void Init(DgvFilterManager FilterManager, DgvBaseFilterHost FilterHost, DataGridViewColumn gridColumn,DataView boundDataView)
 {
     this.mFilterManager = FilterManager;
     this.mFilterHost = FilterHost;
     this.mDataGridViewColumn = gridColumn;
     this.mBoundDataView = boundDataView;
     this.mOriginalDataGridViewColumnHeaderText = gridColumn.HeaderText;
     if (gridColumn.DataPropertyName != "")
         this.mColumnDataType = boundDataView.Table.Columns[gridColumn.DataPropertyName].DataType;
     else
         this.mColumnDataType = typeof(string);
     FilterHost.FilterClientArea.Controls.Add(this);
     FilterHost.Location = new System.Drawing.Point(0, 0);
     this.Visible = false;
     CancelEventArgs e = new CancelEventArgs(false);
     OnFilterInitializing(this, e);
 }
Exemplo n.º 11
0
        private void FillDataGV()
        {
            Compas.Logic.Config.ConfigurationParametersLogic configurationsLogic = new ConfigurationParametersLogic(manager);
            ListToDataTable listToDataTable = new ListToDataTable();

            DataGV.AutoGenerateColumns = false;
            DataGV.DataSource = listToDataTable.ToDataTable<ViewConfigurationParameter>(configurationsLogic.GetAllView());
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);
            DataGV.Update();
        }
Exemplo n.º 12
0
 private void SetupGridViewFilter()
 {
     filterManager = new DgvFilterManager(dgvData);
 }
Exemplo n.º 13
0
        private void Fill()
        {
            DocumentPaymentsLogic payments = new DocumentPaymentsLogic(manager);
            DataGV.AutoGenerateColumns = false;
            ListToDataTable listToDataTable = new ListToDataTable();
            List<ViewPayment> paymentsList = new List<ViewPayment>();
            if (documentId == null)
                paymentsList = payments.GetAllViewByPeriod(StartDateDTP.Value, EndDateDTP.Value);
            else
            {
                paymentsList = payments.GetAllViewByDocumentID(Convert.ToInt32(documentId));
                StartDateDTP.Enabled = false;
                EndDateDTP.Enabled = false;
            }
            DataGV.DataSource = listToDataTable.ToDataTable<ViewPayment>(paymentsList);
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);
            DataGV.Update();

            SummaryDataGV.AutoGenerateColumns = true;
            var groupResult = from p in paymentsList
                              group p by new { p.FullEmployeeName, p.PaymentTypeName }
                                  into myGroup
                                  where myGroup.Count() > 0
                                  select new { myGroup.Key.FullEmployeeName, myGroup.Key.PaymentTypeName, Count = myGroup.Count(), Suma = myGroup.Sum(a => a.Suma) };
            SummaryDataGV.DataSource = groupResult.ToList();
            SummaryDataGV.Update();
        }
Exemplo n.º 14
0
        private void Fill(string columnName)
        {
            DateTime start = DateTime.Now;
            WaresLogic wares = new WaresLogic(manager);
            DataGV.AutoGenerateColumns = false;
            int? categoryId = null;
            int? manufacturerId = null;
            int? unitId = null;
            //string name = wareFilterUC1.WareName;
            if(categoriesFilterUC1.SelectedCategoryID >= 0)
                categoryId = categoriesFilterUC1.SelectedCategoryID;
            //manufacturerId = wareFilterUC1.ManufacturerID;
            //unitId = wareFilterUC1.UnitID;
            BindingSource bs = new BindingSource();

            var waresList = wares.GetAllView("", categoryId, manufacturerId, unitId);
            //    .Select(a => new
            //{
            //    a.ID,
            //    Name = a.Name,
            //    UnitName = a.WareUnit != null ? a.WareUnit.Name : "",
            //    ManufacturerName = a.WareManufacturer != null ? a.WareManufacturer.Name : "",
            //    CategoryName = a.WareCategory != null ? a.WareCategory.Name : "",
            //    CategoryID = a.CategoryID,
            //    SecondaryUnitID = a.SecondaryUnitID != null ? a.SecondaryUnitID : null,

            //   SecondaryUnitName = a.WareUnit1 != null ? a.WareUnit1.Name : "",
            //   SecondaryUnitQuantity = a.SecondaryUnitQuantity != null ? a.SecondaryUnitQuantity : null,
            //   a.WareCodes,
            //   a.WareTimeLimits
            //});//.OrderBy(a => a.CategoryName).ThenBy(a=> a.Name).ToList();
            //List<WareView> viewList = new List<WareView>();

            DateTime start0 = DateTime.Now;

            //foreach (var a in waresList)
            //{
            //    WareView wv = new WareView();
            //    wv.ID = a.ID;
            //    wv.CategoryID = a.CategoryID;
            //    wv.Name = a.Name;
            //    wv.CategoryName = a.CategoryName;
            //    wv.ManufacturerName = a.ManufacturerName;
            //    wv.UnitName = a.UnitName;
            //    wv.SecondaryUnitID = a.SecondaryUnitID;
            //    wv.SecondaryUnitName = a.SecondaryUnitName;
            //    wv.SecondaryUnitQuantity = a.SecondaryUnitQuantity;
            //    //wv.WareCodes = a.WareCodes.ToList();

            //    //var lastTimeLimit = (from aa in a.WareTimeLimits
            //    //                     where aa.Active == true
            //    //                     select aa).FirstOrDefault();
            //    //if (lastTimeLimit != null)
            //    //    wv.TimeLimit = lastTimeLimit.TimeLimit;
            //    //else
            //    //    wv.TimeLimit = 0;

            //    viewList.Add(wv);
            //}
            DateTime start1 = DateTime.Now;
            //BindingListView<WareView> view = new BindingListView<WareView>(viewList);
            //bs.DataSource = view;
            //bs.Sort = columnName;

            view = new SortableBindingList<ViewWare>(waresList);

            ListToDataTable listToDataTable = new ListToDataTable();
            DataGV.DataSource = listToDataTable.ToDataTable<ViewWare>(waresList);

            //DataGV.DataSource = view;
            DataGV.Update();
            DgvFilterManager filterManager = new DgvFilterManager(DataGV);
            DateTime start2 = DateTime.Now;
            //MessageBox.Show(start.ToString() + " " + start0.ToString() + " " + start1.ToString() + " " + start2.ToString());
        }