GrapeCity MultiRow Windows Forms Documentation
CellName Property (HeaderDropDownList)
Example 


The cell name of the corresponding cells. The filter and sort items operate in the cells with the specified name.
Syntax
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)>
<SRCategoryAttribute("Appearance")>
<SRDescriptionAttribute("Indicates the cell name of the corresponding cells. The filter and sort items operate in the cells with the specified name.")>
<RefreshPropertiesAttribute(RefreshProperties.All)>
<TypeConverterAttribute("GrapeCity.Win.MultiRow.Design.CellNameTypeConverter, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")>
Public Property CellName As String
Dim instance As HeaderDropDownList
Dim value As String
 
instance.CellName = value
 
value = instance.CellName
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[SRCategory("Appearance")]
[SRDescription("Indicates the cell name of the corresponding cells. The filter and sort items operate in the cells with the specified name.")]
[RefreshProperties(RefreshProperties.All)]
[TypeConverter("GrapeCity.Win.MultiRow.Design.CellNameTypeConverter, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")]
public string CellName {get; set;}

Property Value

A System.String that indicates the name of the corresponding cells. It is String.Empty after you set a valid CellName
Remarks
Set the HeaderDropDownList cells with the index or name. The DropDownItem in the list uses this information to get the corresponding cells, and operates on them. Nothing happens if you click on the item and the index or name is invalid.
Example
The following code example shows how to create a drop-down list that can filter or sort. This code example is part of a larger example provided for the 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 do not indicate which cell to be filtered, the cell which has same index with column header cell in row section will be 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 do not indicate which cell to be filtered, the cell which has same index with column header cell in row section will be 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
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

 

 


Copyright © GrapeCity, inc. All rights reserved.