コード例 #1
0
        private void GridView_ShowFilterPopupListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupListBoxEventArgs e)
        {
            //GridView gv = sender as GridView;
            string custom    = DevExpress.XtraGrid.Localization.GridLocalizer.Active.GetLocalizedString(DevExpress.XtraGrid.Localization.GridStringId.PopupFilterCustom);
            string blank     = DevExpress.XtraGrid.Localization.GridLocalizer.Active.GetLocalizedString(DevExpress.XtraGrid.Localization.GridStringId.PopupFilterBlanks);
            string not_blank = DevExpress.XtraGrid.Localization.GridLocalizer.Active.GetLocalizedString(DevExpress.XtraGrid.Localization.GridStringId.PopupFilterNonBlanks);

            for (int i = e.ComboBox.Items.Count - 1; i >= 0; i--)
            {
                if (e.ComboBox.Items[i].ToString() == custom)
                {
                    e.ComboBox.Items.RemoveAt(i);
                    continue;
                }
                if (e.ComboBox.Items[i].ToString() == blank)
                {
                    e.ComboBox.Items.RemoveAt(i);
                    continue;
                }
                if (e.ComboBox.Items[i].ToString() == not_blank)
                {
                    e.ComboBox.Items.RemoveAt(i);
                    continue;
                }
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: SergeyLukshin/Condenser
 private void MainGridView_ShowFilterPopupListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupListBoxEventArgs e)
 {
     try
     {
         string custom    = DevExpress.XtraGrid.Localization.GridLocalizer.Active.GetLocalizedString(DevExpress.XtraGrid.Localization.GridStringId.PopupFilterCustom);
         string blank     = DevExpress.XtraGrid.Localization.GridLocalizer.Active.GetLocalizedString(DevExpress.XtraGrid.Localization.GridStringId.PopupFilterBlanks);
         string not_blank = DevExpress.XtraGrid.Localization.GridLocalizer.Active.GetLocalizedString(DevExpress.XtraGrid.Localization.GridStringId.PopupFilterNonBlanks);
         for (int i = e.ComboBox.Items.Count - 1; i >= 0; i--)
         {
             if (e.ComboBox.Items[i].ToString() == custom)
             {
                 e.ComboBox.Items.RemoveAt(i);
                 continue;
             }
             if (e.ComboBox.Items[i].ToString() == blank)
             {
                 e.ComboBox.Items.RemoveAt(i);
                 continue;
             }
             if (e.ComboBox.Items[i].ToString() == not_blank)
             {
                 e.ComboBox.Items.RemoveAt(i);
                 continue;
             }
         }
     }
     catch (Exception ex)
     {
         MyLocalizer.XtraMessageBoxShow("В программе произошла ошибка. Описание: " + ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #3
0
 private void gridView1_ShowFilterPopupListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupListBoxEventArgs e)
 {
     if (e.Column.FieldName == "RowColor")
     {
         e.ComboBox.DrawItem += ComboBox_DrawItem;
     }
 }
 private void gridView1_ShowFilterPopupListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupListBoxEventArgs e)
 {
     e.ComboBox.Tag    = e.Column;
     e.ComboBox.Popup += new EventHandler(ComboBox_Popup);
 }
 private void OnShowFilterPopupListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupListBoxEventArgs e)
 {
     e.ComboBox.DrawItem -= OnDrawItem;
     e.ComboBox.DrawItem += OnDrawItem;
 }