コード例 #1
0
        /// <summary>
        /// Sample customization for implementing the Find and Replace dialog
        /// </summary>
        private void SampleCustomization()
        {
            EnableControls(false);
            this.gridControl1.ColCount = 20;
            //Populate the grid control
            Random r = new Random();

            for (int i = 1; i <= gridControl1.RowCount; i++)
            {
                for (int j = 1; j <= gridControl1.ColCount; j++)
                {
                    gridControl1[i, j].Text = r.Next(100, 150).ToString();
                }
            }

            //Setup FindReplace dialog
            frDialog = new GridFindReplaceDialogSink(gridControl1);

            //Initial Settings
            options = GridFindTextOptions.None;
            cmbOptions.SelectedIndex = 2;
            this.gridControl1.ForceCurrentCellMoveTo = true;
            this.gridControl1.ThemesEnabled          = true;
            this.gridControl1.CurrentCell.MoveTo(1, 1);

            //tab key navigation set as false to move the next control
            this.gridControl1.WantTabKey = false;
        }
コード例 #2
0
        //Setup the search options.
        private void SetOptions()
        {
            options = GridFindTextOptions.None;
            if (chkMatchCase.Checked)
            {
                options = GridFindTextOptions.MatchCase;
            }
            if (chkMatchWholeCell.Checked)
            {
                options |= GridFindTextOptions.MatchWholeCell;
            }
            if (chkSearchUp.Checked)
            {
                options |= GridFindTextOptions.SearchUp;
            }

            switch (cmbOptions.SelectedIndex)
            {
            case 0: options |= GridFindTextOptions.ColumnOnly; break;

            case 1: options |= GridFindTextOptions.SelectionOnly; break;

            case 2: options |= GridFindTextOptions.WholeTable; break;
            }
        }
コード例 #3
0
 public GridFindReplaceDialog(GridGroupingControl groupinggrid, string themeStyle)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     //System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"Common\Images\Grid\Icon\sficon.ico"));
     //this.Icon = ico;
     grid     = groupinggrid;
     frDialog = new GridFindReplaceDialogSink(grid.TableControl);
     options  = GridFindTextOptions.None;
     this.comboBox1.SelectedIndex = 0;
     grid.QueryCellStyleInfo     += new GridTableCellStyleInfoEventHandler(grid_QueryCellStyleInfo);
     this.Icon = new System.Drawing.Icon(GetIconFile(@"Common\Images\Grid\Icon\sficon.ico"));
 }
コード例 #4
0
        private void BuscarRucGrilla()
        {
            options  = GridFindTextOptions.MatchWholeCell;
            options |= GridFindTextOptions.WholeTable;
            locInfo  = GridRangeInfo.Table();

            if (txtRuc.Text != "")
            {
                frEvents = new GridFindReplaceEventArgs(txtRuc.Text, "", options, locInfo);

                /*locInfo = GridRangeInfo.Table();
                 *
                 *
                 * frEvents = new GridFindReplaceEventArgs(txtSearch.Text, "", options, locInfo);
                 * if (frDialog.Find(frEvents) == null)
                 *  MessageBox.Show("No Matches found for Text" + txtSearch.Text);*/
            }
        }
コード例 #5
0
        private void SetOptions()
        {
            options = GridFindTextOptions.None;
            if (matchChkbox.Checked)
            {
                options = GridFindTextOptions.MatchCase;
            }
            if (matchAllChkbox.Checked)
            {
                options |= GridFindTextOptions.MatchWholeCell;
            }
            if (searchupChkbox.Checked)
            {
                options |= GridFindTextOptions.SearchUp;
            }

            switch (this.comboBox1.SelectedIndex)
            {
            case 0: options |= GridFindTextOptions.ColumnOnly; break;

            case 1: options |= GridFindTextOptions.WholeTable; break;
            }
        }
コード例 #6
0
        public void Найти(string ИскомоеЗначение, bool УчитыватьРегистр, bool ИскатьПредыдущее, bool ТолькоПоСтолбцу)
        {
            this.таблицаФормы.Selections.Clear();
            GridFindTextOptions none = GridFindTextOptions.None;

            if (ТолькоПоСтолбцу)
            {
                none = GridFindTextOptions.ColumnOnly;
            }
            else
            {
                none = GridFindTextOptions.WholeTable;
            }
            if (УчитыватьРегистр)
            {
                none |= GridFindTextOptions.MatchCase;
            }
            if (ИскатьПредыдущее)
            {
                none |= GridFindTextOptions.SearchUp;
            }
            this.findEvents = new GridFindReplaceEventArgs(ИскомоеЗначение, "", none, this.findLocation);
            this.findDialog.Find(this.findEvents);
        }