Пример #1
0
        private void TemplateControl_SelectedValueChanged(object sender, EventArgs e)
        {
            FilterRow filterRow = this.ParentRow as FilterRow;

            if (filterRow == null)
            {
                return;
            }

            object value = ((FilterEditor)this.CellEditorManager).TemplateControl.SelectedValue;

            if (value != null && value.ToString() == s_customText)
            {
                if (m_formCustomFilter == null)
                {
                    m_formCustomFilter = new FormCustomFilter();
                }
                if (m_formCustomFilter.ShowDialog(filterRow.GridControl, this.FieldName) ==
                    System.Windows.Forms.DialogResult.OK)
                {
                    if (m_formCustomFilter.Filter != null)
                    {
                        m_filterItems[s_customText] = m_formCustomFilter.Filter;
                        filterRow.ApplyFilters();
                        return;
                    }
                }

                this.Value = s_anyText;
                ((FilterEditor)this.CellEditorManager).TemplateControl.SelectedValue = s_anyText;
            }
            else
            {
                filterRow.ApplyFilters();
            }
        }
Пример #2
0
        private void TemplateControl_SelectedValueChanged(object sender, EventArgs e)
        {
            FilterRow filterRow = this.ParentRow as FilterRow;
            if (filterRow == null)
            {
                return;
            }

            object value = ((FilterEditor) this.CellEditorManager).TemplateControl.SelectedValue;
            if (value != null && value.ToString() == s_customText)
            {
                if (m_formCustomFilter == null)
                {
                    m_formCustomFilter = new FormCustomFilter();
                }
                if (m_formCustomFilter.ShowDialog(filterRow.GridControl, this.FieldName) ==
                    System.Windows.Forms.DialogResult.OK)
                {
                    if (m_formCustomFilter.Filter != null)
                    {
                        m_filterItems[s_customText] = m_formCustomFilter.Filter;
                        filterRow.ApplyFilters();
                        return;
                    }
                }

                this.Value = s_anyText;
                ((FilterEditor) this.CellEditorManager).TemplateControl.SelectedValue = s_anyText;
            }
            else
            {
                filterRow.ApplyFilters();
            }
        }