GrapeCity MultiRow Windows Forms Documentation
HeaderDropDownList Constructor(Int32,Boolean,Boolean)
Example 


The cell index of the corresponding cells. The filter and sort items operate on the cells with the specified index.
A bool value that indicates whether to add the default filter items to the list.
A bool value that indicates whether to add the default sort items to the list.
Initializes a new instance of the HeaderDropDownList class with the specified items.
Syntax
Public Function New( _
   ByVal cellIndex As Integer, _
   ByVal autoAddFilterItems As Boolean, _
   ByVal autoAddSortItems As Boolean _
)
Dim cellIndex As Integer
Dim autoAddFilterItems As Boolean
Dim autoAddSortItems As Boolean
 
Dim instance As New HeaderDropDownList(cellIndex, autoAddFilterItems, autoAddSortItems)
public HeaderDropDownList( 
   int cellIndex,
   bool autoAddFilterItems,
   bool autoAddSortItems
)

Parameters

cellIndex
The cell index of the corresponding cells. The filter and sort items operate on the cells with the specified index.
autoAddFilterItems
A bool value that indicates whether to add the default filter items to the list.
autoAddSortItems
A bool value that indicates whether to add the default sort items to the list.
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeExceptionThe cellIndex is less than 0.
Remarks
The autoAddFilterItems and autoAddSortItems parameters allow you to add default items to the list. autoAddFilterItems will add DropDownShowAllFilterItem, DropDownBlanksFilterItem, DropDownNonBlanksFilterItem, and DropDownAutoFilterItem. autoAddSortItems will add a DropDownSortItem for System.Windows.Forms.SortOrder.Ascending and another DropDownSortItem for System.Windows.Forms.SortOrder.Descending. In addition, a DropDownSeparatorItem is used to separate the filter and sort items.
Example
The following code example shows how to create a drop-down list for the column header cell to allow the user to sort or filter. This code example is part of a larger example provided for the DropDownList property.
void setFirstColumnDropDownListButton_Click(object sender, EventArgs e)
        {
            // Get first column header cell.
            ColumnHeaderCell columnHeaderCell = this.gcMultiRow1.ColumnHeaders[0][0] as ColumnHeaderCell;

            // Create a drop down list with some default down down items.
            columnHeaderCell.DropDownList = new HeaderDropDownList(0, true, true);
        }
Private Sub setFirstColumnDropDownListButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setFirstColumnDropDownListButton.Click
        ' Get first column header cell.
        Dim columnHeaderCell As ColumnHeaderCell = TryCast(Me.gcMultiRow1.ColumnHeaders(0)(0), ColumnHeaderCell)

        ' Create a drop down list with some default down down items.
        columnHeaderCell.DropDownList = New HeaderDropDownList(0, True, True)
    End Sub
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

HeaderDropDownList Class
HeaderDropDownList Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.