Home - Forums-.NET - FlyGrid.Net (Windows Forms) - FilterMode options

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

FilterMode options
Link Posted: 09-Nov-2006 02:38
Thanks, this works great.
Link Posted: 22-Feb-2007 23:17
Is there a way to override the UI used for FilterMode.Custom ?

I want to create my own dialog and then program the filters entered by the user.
Link Posted: 25-Feb-2007 00:57
Yes, you can override the FilterCollectionEditor.EditValue(NineRays.FlyGrid.Design.dll) method or override Filter.Filters property (this will available in the nearest update) to provide your own FilterCollection inheritor.
Link Posted: 27-Feb-2007 22:52
We currently have 1.4.4.0 version and Filter.Filters not available to override. Is that update you reffered to hasnt been released yet?
Link Posted: 27-Feb-2007 23:51
I mean the v.1.4.5.0 that currently available for downloading.
Link Posted: 04-Jul-2007 23:44
[quote="NineRays"]I've corrected example to prevent code from exception mentioned:
[c#]
private void InitGrid(FlyGrid grid)
{
  //connect to ColumnFilterValidate event
  grid.ColumnFilterValidate += new ColumnFilterListValidateHandler(ColumnFilterValidate);
}

private void ColumnFilterValidate(object sender, Column column, ArrayList filterList)
{
  if (column.Caption == "Order Date")
  {    
    filterList.Clear();
    DateTime end93 = new DateTime(1993, 12, 31);
    DateTime end94 = new DateTime(1994, 12, 31);
    DateTime end95 = new DateTime(1995, 12, 31);
    DateTime end96 = new DateTime(1996, 12, 31);
    CultureInfo ivCulture = CultureInfo.InvariantCulture;
    FilterItem[] in94Year= new FilterItem[] {
      new FilterItem(end93.ToString(ivCulture.DateTimeFormat.ShortDatePattern, ivCulture), FilterOperator.And, ConditionOperator.GreaterThan),
      new FilterItem(end94.ToString(ivCulture.DateTimeFormat.ShortDatePattern, ivCulture), FilterOperator.And, ConditionOperator.LessThanOrEqual)
    };
    FilterItem[] in95Year= new FilterItem[] {
      new FilterItem(end94.ToString(ivCulture.DateTimeFormat.ShortDatePattern, ivCulture), FilterOperator.And, ConditionOperator.GreaterThan),
      new FilterItem(end95.ToString(ivCulture.DateTimeFormat.ShortDatePattern, ivCulture), FilterOperator.And, ConditionOperator.LessThanOrEqual)
    };
    FilterItem[] in96Year= new FilterItem[] {
      new FilterItem(end95.ToString(ivCulture.DateTimeFormat.ShortDatePattern, ivCulture), FilterOperator.And, ConditionOperator.GreaterThan),
      new FilterItem(end96.ToString(ivCulture.DateTimeFormat.ShortDatePattern, ivCulture), FilterOperator.And, ConditionOperator.LessThanOrEqual)
    };
    filterList.Add(new FilterHelper("[All]", FilterMode.All));
    filterList.Add(new FilterHelper("[Custom]", FilterMode.Custom));
    filterList.Add(new FilterHelper("Only 1994 year", in94Year));
    filterList.Add(new FilterHelper("Only 1995 year", in95Year));
    filterList.Add(new FilterHelper("Only 1996 year", in96Year));
  }
}


Hi, this code doesn't work, well not when I impliment it:


void ColumnFilterValidate(object sender, Column column, System.Collections.ArrayList filterList)
{
    if (column.Caption == "Trade Date")
    {
        // Clear the Filter list and add the default option to show all records
        filterList.Clear();
        filterList.Add(new FilterHelper("[All]", FilterMode.All));

        if (tradeDates != null && tradeDates.Count > 0)
        {
            tradeDates.Sort();
            foreach (DateTime dt in tradeDates)
            {
                // New filter option for each date
                FilterItem[] fi = new FilterItem[]
                    {
                        new FilterItem(dt, FilterOperator.And, ConditionOperator.GreaterThanOrEqual),
                        new FilterItem(dt.AddDays(1), FilterOperator.And, ConditionOperator.LessThan)
                    };
                filterList.Add(new FilterHelper(dt.ToShortDateString(), fi));
            }
        }
    }
}