GrapeCity MultiRow Windows Forms Documentation
DropDownAutoFilterItem Class
Members  Example 


Represents the automatically generated items in HeaderDropDownList. This class cannot be inherited.
Object Model
DropDownAutoFilterItem ClassHeaderDropDownList Class
Syntax
<ToolboxBitmapAttribute()>
Public NotInheritable Class DropDownAutoFilterItem 
   Inherits DropDownItem
   Implements INamedObject 
Dim instance As DropDownAutoFilterItem
[ToolboxBitmap()]
public sealed class DropDownAutoFilterItem : DropDownItem, INamedObject  
Remarks

The filter operation is applied to the cells specified by the HeaderDropDownList.CellIndex or HeaderDropDownList.CellName, and between HeaderDropDownList.StartRow and HeaderDropDownList.EndRow.

The DropDownAutoFilterItem can automatically generate items for the cells. It raises a DropDownItemNeeded event for each FormattedValue. You can create a DropDownCustomFilterItem for each filter value in the event handler. If the event is not handled, a default DropDownCustomFilterItem is created based on the filter value. For better performance, if the filter values are more than MaxCount, the redundant items are discarded.

Note:
The DropDownAutoFilterItem cannot generate filter items for ImageCell.

Example
The following code example shows how to use this drop-down item to sort or filter. This code example is part of a larger example provided for the ColumnHeaderCell.DropDownList property.
void setSecondColumnDropDownListButton_Click(object sender, EventArgs e)
        {
            // Create a header drop down list without default down down items.
            HeaderDropDownList headerDropDownList = new HeaderDropDownList();

            // If you do not indicate which cell to filter, the cell with the same index as the column header cell in the row       
      // section is filtered.
            headerDropDownList.CellName = "textBoxCell2";

            DropDownItemCollection dropDownItemCollection = headerDropDownList.Items;
            // Initialize drop down items manually.
            // Add sort item.
            dropDownItemCollection.Add(new DropDownSortItem(SortOrder.Ascending));
            dropDownItemCollection.Add(new DropDownSortItem(SortOrder.Descending));
            
            // Add a separator line.
            dropDownItemCollection.Add(new DropDownSeparatorItem());

            // Add show all, black and none black items.
            dropDownItemCollection.Add(new DropDownShowAllFilterItem());
            dropDownItemCollection.Add(new DropDownBlanksFilterItem());
            dropDownItemCollection.Add(new DropDownNonBlanksFilterItem());

            // Add auto filter items.
            dropDownItemCollection.Add(new DropDownAutoFilterItem());

            // Get second column header cell.
            ColumnHeaderCell columnHeaderCell = this.gcMultiRow1.ColumnHeaders[0][1] as ColumnHeaderCell;
            columnHeaderCell.DropDownList = headerDropDownList;
        }
Private Sub setSecondColumnDropDownListButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles 
setSecondColumnDropDownListButton.Click
        ' Create a header drop down list without default down down items.
        Dim headerDropDownList As New HeaderDropDownList()

        ' If you do not indicate which cell to filter, the cell with the same index as the column header cell in the row section 
        ' is filtered.
        headerDropDownList.CellName = "textBoxCell2"

        Dim dropDownItemCollection As DropDownItemCollection = headerDropDownList.Items
        ' Initialize drop down items manually.
        ' Add sort item.
        dropDownItemCollection.Add(New DropDownSortItem(SortOrder.Ascending))
        dropDownItemCollection.Add(New DropDownSortItem(SortOrder.Descending))

        ' Add a separator line.
        dropDownItemCollection.Add(New DropDownSeparatorItem())

        ' Add show all, black and none black items.
        dropDownItemCollection.Add(New DropDownShowAllFilterItem())
        dropDownItemCollection.Add(New DropDownBlanksFilterItem())
        dropDownItemCollection.Add(New DropDownNonBlanksFilterItem())

        ' Add auto filter items.
        dropDownItemCollection.Add(New DropDownAutoFilterItem())

        ' Get second column header cell.
        Dim columnHeaderCell As ColumnHeaderCell = TryCast(Me.gcMultiRow1.ColumnHeaders(0)(1), 
ColumnHeaderCell)
        columnHeaderCell.DropDownList = headerDropDownList
    End Sub
Inheritance Hierarchy

System.Object
   GrapeCity.Win.MultiRow.DropDownItem
      GrapeCity.Win.MultiRow.DropDownAutoFilterItem

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

DropDownAutoFilterItem Members
GrapeCity.Win.MultiRow Namespace
HeaderDropDownList Class
DropDownItemCollection Class
DropDownItem Class
DropDownShowAllFilterItem Class
DropDownBlanksFilterItem Class
DropDownNonBlanksFilterItem Class
DropDownCustomFilterItem Class
DropDownList Property

 

 


Copyright © GrapeCity, inc. All rights reserved.