public static void ShowFilterPopupCheckedListBox(GridView gridView1, object sender, FilterPopupCheckedListBoxEventArgs e)
{
e.CheckedComboBox.BeginUpdate();
try
{
gridView1.OptionsFilter.AllowColumnMRUFilterList = false;
e.CheckedComboBox.Items.Clear();
List<string> Availble = new List<string>();
for (int i = 0; i < gridView1.RowCount; i++)
{
try
{
DevExpress.XtraGrid.Views.Grid.FilterItem f = new DevExpress.XtraGrid.Views.Grid.FilterItem(gridView1.GetRowCellValue(i, e.Column.FieldName).ToString(), gridView1.GetRowCellValue(i, e.Column.FieldName).ToString());
if (i == 0)
{
Availble.Add(f.Text);
e.CheckedComboBox.Items.Add(f);
}
if (!Availble.Contains(f.Text))
{
Availble.Add(f.Text);
e.CheckedComboBox.Items.Add(f);
}
}
catch (Exception Ex)
{
}
}
Availble.Sort();
e.CheckedComboBox.Items.Clear();
for (int i = 0; i < Availble.Count; i++)
{
DevExpress.XtraGrid.Views.Grid.FilterItem f = new DevExpress.XtraGrid.Views.Grid.FilterItem(Availble[i].ToString(), Availble[i].ToString());
e.CheckedComboBox.Items.Add(f);
}
}
finally
{
e.CheckedComboBox.EndUpdate();
}
}
{
e.CheckedComboBox.BeginUpdate();
try
{
gridView1.OptionsFilter.AllowColumnMRUFilterList = false;
e.CheckedComboBox.Items.Clear();
List<string> Availble = new List<string>();
for (int i = 0; i < gridView1.RowCount; i++)
{
try
{
DevExpress.XtraGrid.Views.Grid.FilterItem f = new DevExpress.XtraGrid.Views.Grid.FilterItem(gridView1.GetRowCellValue(i, e.Column.FieldName).ToString(), gridView1.GetRowCellValue(i, e.Column.FieldName).ToString());
if (i == 0)
{
Availble.Add(f.Text);
e.CheckedComboBox.Items.Add(f);
}
if (!Availble.Contains(f.Text))
{
Availble.Add(f.Text);
e.CheckedComboBox.Items.Add(f);
}
}
catch (Exception Ex)
{
}
}
Availble.Sort();
e.CheckedComboBox.Items.Clear();
for (int i = 0; i < Availble.Count; i++)
{
DevExpress.XtraGrid.Views.Grid.FilterItem f = new DevExpress.XtraGrid.Views.Grid.FilterItem(Availble[i].ToString(), Availble[i].ToString());
e.CheckedComboBox.Items.Add(f);
}
}
finally
{
e.CheckedComboBox.EndUpdate();
}
}
0 Comments