menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class KanbanColumn - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class KanbanColumn

    Represents a Kanban column, providing functionality for property limits, column titles, item grouping, and card drag-and-drop operations.

    Inheritance
    System.Object
    KanbanColumn
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Namespace: Syncfusion.UI.Xaml.Kanban
    Assembly: Syncfusion.Kanban.WinUI.dll
    Syntax
    public class KanbanColumn : ItemsControl, INotifyPropertyChanged

    Constructors

    KanbanColumn()

    Initializes a new instance of the KanbanColumn class.

    Declaration
    public KanbanColumn()

    Fields

    AllowDragProperty

    Using a DependencyProperty as the backing store for AllowDrag. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty AllowDragProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    CategoriesProperty

    Using a DependencyProperty as the backing store for Categories. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty CategoriesProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    ErrorBarSettingsProperty

    Using a DependencyProperty as the backing store for ErrorBarSettings. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty ErrorBarSettingsProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    HeaderTextProperty

    Using a DependencyProperty as the backing store for HeaderText. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty HeaderTextProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    IsExpandedProperty

    Using a DependencyProperty as the backing store for IsExpanded. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty IsExpandedProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    MaximumCountProperty

    Using a DependencyProperty as the backing store for MaximumCount. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty MaximumCountProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    MinimumCountProperty

    Using a DependencyProperty as the backing store for MinimumCount. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty MinimumCountProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    Properties

    AllowDrag

    Gets or sets a value indicating whether items can be dragged within or out of this KanbanColumn.

    Declaration
    public bool AllowDrag { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value of AllowDrag is true.

    Remarks

    Setting this property to true enables drag operations for the column, allowing cards to be moved within the column or to other columns. This is useful for managing tasks and workflow in a Kanban board.

    Examples

    The below examples shows, how to set AllowDrag property of KanbanColumn in the SfKanban.

    # [XAML](#tab/tabid-19)
    <kanban:SfKanban x:Name="kanban"
                     ItemsSource="{Binding TaskDetails}">
        <kanban:SfKanban.DataContext>
               <local:ViewModel />
         </kanban:SfKanban.DataContext>
        <kanban:KanbanColumn AllowDrag="false"
                             Categories="Open"
                             HeaderText="Open"/>
    </kanban:SfKanban>
    # [C#](#tab/tabid-20)
    public class ViewModel
    {
        public ViewModel()
        {
            TaskDetails = new ObservableCollection<KanbanModel>();
            TaskDetails.Add(new KanbanModel()
            {
                Title = "Universal App",
                Id = "6593",
                Description = "Draft preliminary software specifications",
                Category = "Review",
                IndicatorColorKey = "High",
                Tags = new List<string> { "Analysis" },
            });
        }
        public ObservableCollection<KanbanModel> TaskDetails { get; set; }
    }
    # [C#](#tab/tabid-21)
    this.kanban.ItemsSource = new ViewModel().TaskDetails;
    this.kanban.Columns.Add(new KanbanColumn()
    {
       Categories = "Open",
       HeaderText="Open",
       AllowDrag = false,
    });
    See Also
    AutoGenerateColumns
    ErrorBarSettings
    Categories
    MinimumCount
    MaximumCount
    IsExpanded
    HeaderText
    ValidationColor

    AllowedTransitionCategory

    Gets the category key for the multiple category content control while dragging.

    Declaration
    public object AllowedTransitionCategory { get; }
    Property Value
    Type
    System.Object
    Remarks

    This property is used to manage the category key when multiple categories are involved in a drag-and-drop operation. It helps in determining the appropriate category for the content being dragged.

    CardsCount

    Gets the number of cards in the KanbanColumn.

    Declaration
    public int CardsCount { get; }
    Property Value
    Type Description
    System.Int32

    The default value of CardsCount is 0.

    Remarks

    This property provides the total count of cards currently present in the kanban column. It is useful for tracking the number of tasks or items in a specific column. For minimum and maximum validation colors, refer to MinimumValidationColor and MaximumValidationColor. For minimum and maximum count limits, refer to MinimumCount and MaximumCount.

    Categories

    Gets or sets a string that specifies the fields used for grouping in KanbanColumn.

    Declaration
    public string Categories { get; set; }
    Property Value
    Type Description
    System.String

    The default value of Categories is System.String.Empty.

    Remarks

    This property allows you to define which categories or fields will be used for data grouping, enabling effective categorization within the Kanban model.

    Examples

    The below examples shows, how to set Categories property of KanbanColumn in the SfKanban.

    # [XAML](#tab/tabid-1)
    <kanban:SfKanban x:Name="kanban"
                     ItemsSource="{Binding TaskDetails}">
        <kanban:SfKanban.DataContext>
               <local:ViewModel />
         </kanban:SfKanban.DataContext>
        <kanban:KanbanColumn Categories="Open" />
    </kanban:SfKanban>
    # [C#](#tab/tabid-2)
    public class ViewModel
    {
        public ViewModel()
        {
            TaskDetails = new ObservableCollection<KanbanModel>();
            TaskDetails.Add(new KanbanModel()
            {
                Title = "Universal App",
                Id = "6593",
                Description = "Draft preliminary software specifications",
                Category = "Review",
                IndicatorColorKey = "High",
                Tags = new List<string> { "Analysis" },
            });
        }
        public ObservableCollection<KanbanModel> TaskDetails { get; set; }
    }
    # [C#](#tab/tabid-3)
    this.kanban.ItemsSource = new ViewModel().TaskDetails;
    this.kanban.Columns.Add(new KanbanColumn()
    {
       Categories = "Open",
    });
    See Also
    AutoGenerateColumns
    ErrorBarSettings
    HeaderText
    MaximumCount
    MinimumCount
    AllowDrag
    IsExpanded
    ValidationColor

    ErrorBarSettings

    Gets or sets the error bar settings that define the appearance and behavior of error bars in the KanbanColumn.

    Declaration
    public KanbanErrorBarSettings ErrorBarSettings { get; set; }
    Property Value
    Type Description
    KanbanErrorBarSettings

    The default value of ErrorBarSettings is null.

    Remarks

    These settings include properties such as the height, color, and validation indicators for minimum and maximum values. They help in visually indicating validation states within the Kanban column, ensuring that the column adheres to specified limits.

    Examples

    The below examples shows, how to set ErrorBarSettings property of KanbanColumn in the SfKanban.

    # [XAML](#tab/tabid-4)
    <kanban:SfKanban x:Name="kanban"
                     ItemsSource="{Binding TaskDetails}">
        <kanban:SfKanban.DataContext>
               <local:ViewModel />
        </kanban:SfKanban.DataContext>
        <kanban:KanbanColumn MinimumCount="2"
                             MaximumCount="5"
                             HeaderText="Open" 
                             Categories="Open">
           <kanban:KanbanColumn.ErrorBarSettings>
               <kanban:KanbanErrorBarSettings MaximumValidationColor="Red"
                                              MinimumValidationColor="Yellow" />
               </kanban:KanbanColumn.ErrorBarSettings>
           </kanban:KanbanColumn>
    </kanban:SfKanban>
    # [C#](#tab/tabid-5)
    public class ViewModel
    {
        public ViewModel()
        {
            TaskDetails = new ObservableCollection<KanbanModel>();
            TaskDetails.Add(new KanbanModel()
            {
                Title = "Universal App",
                Id = "6593",
                Description = "Draft preliminary software specifications",
                Category = "Review",
                IndicatorColorKey = "High",
                Tags = new List<string> { "Analysis" },
            });
        }
        public ObservableCollection<KanbanModel> TaskDetails { get; set; }
    }
    # [C#](#tab/tabid-6)
    this.kanban.ItemsSource = new ViewModel().TaskDetails;
    this.kanban.Columns.Add(new KanbanColumn()
    {
       Categories = "Open",
       ErrorBarSettings = new KanbanErrorBarSettings()
       {
          MaximumValidationCoWlor = new SolidColorBrush(Colors.Red),
          MinimumValidationColor = new SolidColorBrush(Colors.Yellow),
       }
    });
    See Also
    AutoGenerateColumns
    ItemsSource
    KanbanModel
    MinimumCount
    MaximumCount
    ValidationColor

    HeaderText

    Gets or sets the header text displayed for the KanbanColumn.

    Declaration
    public string HeaderText { get; set; }
    Property Value
    Type Description
    System.String

    The default value of HeaderText is null.

    Remarks

    This property allows you to define a title or label for the column, making it easily identifiable. It helps in organizing and distinguishing different columns within the Kanban board.

    Examples

    The below examples shows, how to set HeaderText property of KanbanColumn in the SfKanban.

    # [XAML](#tab/tabid-7)
    <kanban:SfKanban x:Name="kanban"
                     ItemsSource="{Binding TaskDetails}">
        <kanban:SfKanban.DataContext>
               <local:ViewModel />
         </kanban:SfKanban.DataContext>
        <kanban:KanbanColumn Categories="Open"
                             HeaderText="Open"/>
    </kanban:SfKanban>
    # [C#](#tab/tabid-8)
    public class ViewModel
    {
        public ViewModel()
        {
            TaskDetails = new ObservableCollection<KanbanModel>();
            TaskDetails.Add(new KanbanModel()
            {
                Title = "Universal App",
                Id = "6593",
                Description = "Draft preliminary software specifications",
                Category = "Review",
                IndicatorColorKey = "High",
                Tags = new List<string> { "Analysis" },
            });
        }
        public ObservableCollection<KanbanModel> TaskDetails { get; set; }
    }
    # [C#](#tab/tabid-9)
    this.kanban.ItemsSource = new ViewModel().TaskDetails;
    this.kanban.Columns.Add(new KanbanColumn()
    {
       Categories = "Open",
       HeaderText="Open",
    });
    See Also
    AutoGenerateColumns
    ErrorBarSettings
    Categories
    MinimumCount
    MaximumCount
    AllowDrag
    IsExpanded
    ValidationColor

    IsExpanded

    Gets or sets a value indicating whether the KanbanColumn is in an expanded or collapsed state.

    Declaration
    public bool IsExpanded { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value of IsExpanded is true.

    Remarks

    When set, this property determines the visibility and layout of the column content based on its state. Expanding the column shows all its cards, while collapsing hides them, providing a more compact view.

    Examples

    The below examples shows, how to set IsExpanded property of KanbanColumn in the SfKanban.

    # [XAML](#tab/tabid-16)
    <kanban:SfKanban x:Name="kanban"
                     ItemsSource="{Binding TaskDetails}">
        <kanban:SfKanban.DataContext>
               <local:ViewModel />
         </kanban:SfKanban.DataContext>
        <kanban:KanbanColumn IsExpanded="false"
                             Categories="Open"
                             HeaderText="Open"/>
    </kanban:SfKanban>
    # [C#](#tab/tabid-17)
    public class ViewModel
    {
        public ViewModel()
        {
            TaskDetails = new ObservableCollection<KanbanModel>();
            TaskDetails.Add(new KanbanModel()
            {
                Title = "Universal App",
                Id = "6593",
                Description = "Draft preliminary software specifications",
                Category = "Review",
                IndicatorColorKey = "High",
                Tags = new List<string> { "Analysis" },
            });
        }
        public ObservableCollection<KanbanModel> TaskDetails { get; set; }
    }
    # [C#](#tab/tabid-18)
    this.kanban.ItemsSource = new ViewModel().TaskDetails;
    this.kanban.Columns.Add(new KanbanColumn()
    {
       Categories = "Open",
       HeaderText="Open",
       IsExpanded = false,
    });
    See Also
    AutoGenerateColumns
    ErrorBarSettings
    Categories
    MinimumCount
    MaximumCount
    AllowDrag
    HeaderText
    ValidationColor

    MaximumCount

    Gets or sets the maximum validation limit for the KanbanColumn.

    Declaration
    public int MaximumCount { get; set; }
    Property Value
    Type Description
    System.Int32

    The default value of MaximumCount is -1.

    Remarks

    This property specifies the upper threshold value, above which the validation is indicated using the assigned validation color.

    Examples

    The below examples shows, how to set MaximumCount property of KanbanColumn in the SfKanban.

    # [XAML](#tab/tabid-13)
    <kanban:SfKanban x:Name="kanban"
                     ItemsSource="{Binding TaskDetails}">
        <kanban:SfKanban.DataContext>
               <local:ViewModel />
        </kanban:SfKanban.DataContext>
        <kanban:KanbanColumn MaximumCount="10"
                             HeaderText="Open" 
                             Categories="Open">
           <kanban:KanbanColumn.ErrorBarSettings>
               <kanban:KanbanErrorBarSettings MaximumValidationColor="Red" />
               </kanban:KanbanColumn.ErrorBarSettings>
           </kanban:KanbanColumn>
    </kanban:SfKanban>
    # [C#](#tab/tabid-14)
    public class ViewModel
    {
        public ViewModel()
        {
            TaskDetails = new ObservableCollection<KanbanModel>();
            TaskDetails.Add(new KanbanModel()
            {
                Title = "Universal App",
                Id = "6593",
                Description = "Draft preliminary software specifications",
                Category = "Review",
                IndicatorColorKey = "High",
                Tags = new List<string> { "Analysis" },
            });
        }
        public ObservableCollection<KanbanModel> TaskDetails { get; set; }
    }
    # [C#](#tab/tabid-15)
    this.kanban.ItemsSource = new ViewModel().TaskDetails;
    this.kanban.Columns.Add(new KanbanColumn()
    {
       Categories = "Open",
       MaximumCount=10,
       ErrorBarSettings = new KanbanErrorBarSettings()
       {
          MaximumValidationColor = new SolidColorBrush(Colors.Red),
       }
    });
    See Also
    AutoGenerateColumns
    ItemsSource
    KanbanModel
    MinimumCount
    ErrorBarSettings
    HeaderText
    AllowDrag
    IsExpanded
    ValidationColor

    MinimumCount

    Gets or sets the minimum validation limit for the KanbanColumn.

    Declaration
    public int MinimumCount { get; set; }
    Property Value
    Type Description
    System.Int32

    The default value of MinimumCount is -1.

    Remarks

    This property specifies the threshold value, below which the validation is indicated using the assigned validation color.

    Examples

    The below examples shows, how to set MinimumCount property of KanbanColumn in the SfKanban.

    # [XAML](#tab/tabid-10)
    <kanban:SfKanban x:Name="kanban"
                     ItemsSource="{Binding TaskDetails}">
        <kanban:SfKanban.DataContext>
               <local:ViewModel />
        </kanban:SfKanban.DataContext>
        <kanban:KanbanColumn MinimumCount="2"
                             HeaderText="Open" 
                             Categories="Open">
           <kanban:KanbanColumn.ErrorBarSettings>
               <kanban:KanbanErrorBarSettings MinimumValidationColor="Yellow" />
               </kanban:KanbanColumn.ErrorBarSettings>
           </kanban:KanbanColumn>
    </kanban:SfKanban>
    # [C#](#tab/tabid-11)
    public class ViewModel
    {
        public ViewModel()
        {
            TaskDetails = new ObservableCollection<KanbanModel>();
            TaskDetails.Add(new KanbanModel()
            {
                Title = "Universal App",
                Id = "6593",
                Description = "Draft preliminary software specifications",
                Category = "Review",
                IndicatorColorKey = "High",
                Tags = new List<string> { "Analysis" },
            });
        }
        public ObservableCollection<KanbanModel> TaskDetails { get; set; }
    }
    # [C#](#tab/tabid-12)
    this.kanban.ItemsSource = new ViewModel().TaskDetails;
    this.kanban.Columns.Add(new KanbanColumn()
    {
       Categories = "Open",
       MinimumCount=2,
       ErrorBarSettings = new KanbanErrorBarSettings()
       {
          MinimumValidationColor = new SolidColorBrush(Colors.Yellow),
       }
    });
    See Also
    AutoGenerateColumns
    ItemsSource
    KanbanModel
    MaximumCount
    ErrorBarSettings
    HeaderText
    AllowDrag
    IsExpanded
    ValidationColor

    ValidationColor

    Gets a brush that specifies the color of the error bar for the KanbanColumn.

    Declaration
    public Brush ValidationColor { get; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    The default value of ValidationColor is Microsoft.UI.Colors.Gray.

    Remarks

    This property allows customization of the error bar's appearance by specifying a Microsoft.UI.Xaml.Media.Brush. It helps in visually indicating validation states within the Kanban column. Based on the values of MinimumCount, MaximumCount, MinimumValidationColor, and MaximumValidationColor, this property value will be set for the specific column.

    Methods

    GetContainerForItemOverride()

    Provides a container for each item in the KanbanColumn.

    Declaration
    protected override DependencyObject GetContainerForItemOverride()
    Returns
    Type Description
    Microsoft.UI.Xaml.DependencyObject

    The new instance of KanbanCardItem.

    IsItemItsOwnContainerOverride(Object)

    Method to check whether the item is kanban card item or not.

    Declaration
    protected override bool IsItemItsOwnContainerOverride(object item)
    Parameters
    Type Name Description
    System.Object item

    The item to check.

    Returns
    Type Description
    System.Boolean

    True if the item is a KanbanCardItem; otherwise, false.

    OnApplyTemplate()

    Method to apply the template.

    Declaration
    protected override void OnApplyTemplate()

    OnDragLeave(DragEventArgs)

    Called when the drag-and-drop operation leaves this kanban column.

    Declaration
    protected override void OnDragLeave(DragEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.DragEventArgs e

    The event arguments.

    OnDragOver(DragEventArgs)

    Handles the drag-over event, allowing custom processing during a drag operation.

    Declaration
    protected override void OnDragOver(DragEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.DragEventArgs e

    The drag event arguments.

    OnDrop(DragEventArgs)

    Handles the drop event, allowing custom processing when an item is dropped.

    Declaration
    protected override void OnDrop(DragEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.DragEventArgs e

    The event arguments.

    OnHolding(HoldingRoutedEventArgs)

    Occurs when the column in holding state.

    Declaration
    protected override void OnHolding(HoldingRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.HoldingRoutedEventArgs e

    The routed event args.

    OnPointerExited(PointerRoutedEventArgs)

    Occurs when the pointer exits in the column area.

    Declaration
    protected override void OnPointerExited(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e

    The routed event args.

    Events

    PropertyChanged

    Occurs when a property value changes.

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type
    System.ComponentModel.PropertyChangedEventHandler

    Implements

    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved