protected void ASPxGridView1_HeaderFilterFillItems(object sender, ASPxGridViewHeaderFilterEventArgs e) { if (e.Column.FieldName != "Month") { return; } e.Values.Clear(); for (int i = 1; i <= 12; i++) { e.AddValue(NumberMonthConverter.GetTitleOfMonth(i), i.ToString()); } }
protected void ASPxGridView1_AutoFilterCellEditorInitialize(object sender, DevExpress.Web.ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName != "Month") { return; } ASPxComboBox comboBox = e.Editor as ASPxComboBox; comboBox.ValueType = typeof(string); for (int i = 1; i <= 12; i++) { comboBox.Items.Add(NumberMonthConverter.GetTitleOfMonth(i), i); } }
protected void ASPxGridView1_ProcessColumnAutoFilter(object sender, ASPxGridViewAutoFilterEventArgs e) { if (e.Column.FieldName != "Month") { return; } if (e.Kind == GridViewAutoFilterEventKind.CreateCriteria) { e.Criteria = new BinaryOperator(e.Column.FieldName, e.Value, BinaryOperatorType.Equal); } else if (e.Value != string.Empty) { e.Value = NumberMonthConverter.GetTitleOfMonth(Convert.ToInt32(e.Value)); } }