Exemplo n.º 1
0
        // Sorts the grid
        // Can't use SortCompare method because this grid is data-bound
        private void dataGridViewCapValues_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dataGridViewCapValues.DataSource != null && iframes != null && listBindingCap != null)
            {
                DataGridViewColumn selectedColumn = dataGridViewCapValues.Columns[e.ColumnIndex];

                var iframeCaptureComparer = new IFrameCaptureComparer
                {
                    CompareType = selectedColumn.DataPropertyName
                };

                if (selectedColumn.HeaderCell.SortGlyphDirection == SortOrder.Ascending)
                {
                    iframeCaptureComparer.sortOrder = SortOrder.Descending;
                }

                iframes.Sort(iframeCaptureComparer);

                listBindingCap.ResetBindings(false);
                selectedColumn.HeaderCell.SortGlyphDirection = iframeCaptureComparer.sortOrder;
            }
        }
Exemplo n.º 2
0
        private void ResortGrid(BindingSource bindingSource, DoubleBufferedDataGridView dataGrid, FrameType frameType)
        {
            switch (frameType)
            {
                case FrameType.Method5Standard:
                case FrameType.Method5Natures:
                case FrameType.Wondercard5thGen:
                case FrameType.Wondercard5thGenFixed:
                    var iframeCaptureComparer = new IFrameCaptureComparer {CompareType = "TimeDate"};
                    ((List<IFrameCapture>) bindingSource.DataSource).Sort(iframeCaptureComparer);
                    CapDateTime.HeaderCell.SortGlyphDirection = SortOrder.Ascending;
                    break;
                case FrameType.BWBred:
                case FrameType.BWBredInternational:
                    iframeCaptureComparer = new IFrameCaptureComparer {CompareType = "TimeDate"};
                    ((List<IFrameCapture>) bindingSource.DataSource).Sort(iframeCaptureComparer);
                    ColumnEggDate.HeaderCell.SortGlyphDirection = SortOrder.Ascending;
                    break;
            }

            dataGrid.DataSource = bindingSource;
            bindingSource.ResetBindings(false);
        }
Exemplo n.º 3
0
        // Sorts the grid
        // Can't use SortCompare method because this grid is data-bound
        private void dataGridViewCapValues_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dataGridViewCapValues.DataSource != null && iframes != null && listBindingCap != null)
            {
                DataGridViewColumn selectedColumn = dataGridViewCapValues.Columns[e.ColumnIndex];

                var iframeCaptureComparer = new IFrameCaptureComparer
                    {CompareType = selectedColumn.DataPropertyName};

                if (selectedColumn.HeaderCell.SortGlyphDirection == SortOrder.Ascending)
                    iframeCaptureComparer.sortOrder = SortOrder.Descending;

                iframes.Sort(iframeCaptureComparer);

                listBindingCap.ResetBindings(false);
                selectedColumn.HeaderCell.SortGlyphDirection = iframeCaptureComparer.sortOrder;
            }
        }
Exemplo n.º 4
0
        private void ResortGrid(BindingSource bindingSource, DoubleBufferedDataGridView dataGrid, FrameType frameType)
        {
            switch (frameType)
            {
                case FrameType.MethodJ:
                case FrameType.MethodK:
                    var iframeCaptureComparer = new IFrameCaptureComparer {CompareType = "Seed"};
                    ((List<IFrameCapture>) bindingSource.DataSource).Sort(iframeCaptureComparer);
                    CapSeed.HeaderCell.SortGlyphDirection = SortOrder.Ascending;
                    break;
            }

            dataGrid.DataSource = bindingSource;
            bindingSource.ResetBindings(false);
        }