Spread WPF 18
GrapeCity.Wpf.SpreadSheet.CellType.Editors Namespace / GcListBox Class
Members


In This Topic
    GcListBox Class
    In This Topic
    Represents a control that displays a list of data items.
    Object Model
    GcListBox Class
    Syntax
    'Declaration
     
    <DesignTimeVisibleAttribute(False)>
    <LicenseProviderAttribute(GrapeCity.Common.SpreadLicenseProvider)>
    <TemplatePartAttribute(Name="ScrollViewer", Type=System.Windows.Controls.ScrollViewer)>
    <StyleTypedPropertyAttribute(Property="SubItemStyle", StyleTargetType=GrapeCity.Wpf.SpreadSheet.CellType.Editors.SubItem)>
    <TemplateVisualStateAttribute(Name="Normal", GroupName="CommonStates")>
    <DefaultEventAttribute("OnItemsChanged")>
    <DefaultPropertyAttribute("Items")>
    <ContentPropertyAttribute("Items")>
    <LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable)>
    <XmlLangPropertyAttribute("Language")>
    <UsableDuringInitializationAttribute(True)>
    <RuntimeNamePropertyAttribute("Name")>
    <UidPropertyAttribute("Uid")>
    <TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>
    <NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>
    Public Class GcListBox 
       Inherits System.Windows.Controls.ItemsControl
    'Usage
     
    Dim instance As GcListBox
    [DesignTimeVisible(false)]
    [LicenseProvider(GrapeCity.Common.SpreadLicenseProvider)]
    [TemplatePart(Name="ScrollViewer", Type=System.Windows.Controls.ScrollViewer)]
    [StyleTypedProperty(Property="SubItemStyle", StyleTargetType=GrapeCity.Wpf.SpreadSheet.CellType.Editors.SubItem)]
    [TemplateVisualState(Name="Normal", GroupName="CommonStates")]
    [DefaultEvent("OnItemsChanged")]
    [DefaultProperty("Items")]
    [ContentProperty("Items")]
    [Localizability(LocalizationCategory.None, Readability=Readability.Unreadable)]
    [XmlLangProperty("Language")]
    [UsableDuringInitialization(true)]
    [RuntimeNameProperty("Name")]
    [UidProperty("Uid")]
    [TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)]
    [NameScopeProperty("NameScope", System.Windows.NameScope)]
    public class GcListBox : System.Windows.Controls.ItemsControl 
    Remarks

    GcListBox is an System.Windows.Controls.ItemsControl, which means it can contain a collection of objects of any type (such as string, image, or panel). For more information, see the System.Windows.Controls.ItemsControl class.

    There are two modes to present the data items in a GcListBox, which is specified by the UseMultipleColumn property.

    Set UseMultipleColumn to true, GcListBox will present data in a customizable grid.

    By default, the GcListBox control generates columns automatically when you set the System.Windows.Controls.ItemsControl.ItemsSource or System.Windows.Controls.ItemsControl.Items property. The generated columns are of type ListCheckBoxColumn for bound bool properties, and of type ListImageColumn for bound ImageSource properties, and of type ListTextColumn for all other properties.

    Regardless of whether you generate columns, you can use the Columns collection to programmatically add, insert, remove, and change any columns in the control at run time. Alternatively, you can specify columns in XAML, in which case you should set AutoGenerateColumns to false. Creating your own columns enables you to use additional column types, such as the ListTemplateColumn type or custom column types. The ListTemplateColumn type provides an easy way to create a simple custom column. The ListTemplateColumn.SubItemTemplate property enable you to specify content templates for display.

    If you set ListItem to System.Windows.Controls.ItemsControl.Items or System.Windows.Controls.ItemsControl.ItemsSource, you must be create ListSubItemColumn to display SubItem customized in ListItem.SubItems.

    In this present mode, some properties inherited from System.Windows.Controls.ItemsControl will not take effect, such as System.Windows.Controls.ItemsControl.ItemTemplate, System.Windows.Controls.ItemsControl.DisplayMemberPath, System.Windows.Controls.ItemsControl.ItemsPanel.

    Set UseMultipleColumn to false, GcListBox will present data items with default presentation of System.Windows.Controls.ItemsControl.
    GcListBox will generated ListItemBase as item container for set item data. If you define the ListItem as item data, the ListItem.Content or the SubItem.Content of the first SubItem in the ListItem.SubItems will be wrapped into the generated ListItemBase to present.
    In this present mode, some properties inherited from System.Windows.Controls.ItemsControl will not take effect, such as System.Windows.Controls.ItemsControl.ItemsPanel.

    Supported System.Windows.VisualState list:

    VisualStateGroup Name

    VisualState Name

    Description

    CommonStates

    Normal

    Represents the visual appearance when control is in normal state.

    CommonStates

    Disabled

    Represents the visual appearance when System.Windows.UIElement.IsEnabled is false.

    ActiveStates

    Active

    Represents the visual appearance when IsActive is true.

    ActiveStates

    Inactive

    Represents the visual appearance when IsActive is false.

    ValidationStates

    Valid

    Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns false.

    ValidationStates

    InvalidFocused

    Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns true and control has focus.

    ValidationStates

    InvalidUnfocused

    Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns true and control has no focus.

    Inheritance Hierarchy

    System.Object
       System.Windows.Threading.DispatcherObject
          System.Windows.DependencyObject
             System.Windows.Media.Visual
                System.Windows.UIElement
                   System.Windows.FrameworkElement
                      System.Windows.Controls.Control
                         System.Windows.Controls.ItemsControl
                            GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcListBox

    See Also