File

projects/wms-framework/src/lib/models/controls/XamGridModel.ts

Description

Class that represents the Model of the XamGrid

Extends

Control

Index

Properties
Methods
Accessors

Constructor

constructor()

Creates an instance of XamGridModel.

Properties

Private _activeCell
Type : CellBase

Keeps the current active cell

Private Readonly _rowsManager
Type : XamGridRowsManager
Private _selectionSettings
Type : SelectionSettings

Internal property to keep the current Selection setting for the xamGrid

ActiveCellChanged
Default value : new SubscriptionEvent< (s: XamGridModel, e: any) => void >()
ActiveCellChanging
Default value : new SubscriptionEvent< (s: XamGridModel, e: any) => void >()
Static ActiveItemProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'ActiveItem', null, null )

ActiveItemProperty dependency property

AfterCellControlAttached
Default value : new SubscriptionEvent< (s: XamGridModel, e: CellControlAttachedEventArgs) => void >()

AfterCellControlAttached subscription event

Public AngularComponentId
Default value : AngularComponentId.xamGrid
Inherited from UIElement
Defined in UIElement:596
AutoGenerateColumns
Type : boolean
Decorators :
@Dependency(XamGridModel.AutoGenerateColumnsProperty)

Gets or sets the auto generate columns

Static AutoGenerateColumnsProperty
Type : DependencyProperty
Default value : new DependencyProperty('AutoGenerateColumns', true, null)

AutoGenerateColumnsProperty dependency property

BorderBrush
Type : any
Inherited from Control
Defined in Control:829
BorderThickness
Type : ThicknessModel
Default value : new ThicknessModel()
Inherited from Control
Defined in Control:828
CellClicked
Default value : new SubscriptionEvent< (s: XamGridModel, e: CellClickedEventArgs) => void >()
CellControlAttached
Default value : new SubscriptionEvent< (s: XamGridModel, e: CellControlAttachedEventArgs) => void >()
Static CellControlGenerationModeProperty
Type : DependencyProperty
Default value : new DependencyProperty('CellControlGenerationMode', null, null)

CellControlGenerationModeProperty dependency property

CellDoubleClicked
Default value : new SubscriptionEvent< (s: XamGridModel, e: any) => void >()
CellEdited
Default value : new SubscriptionEvent< (s: XamGridModel, e: ExitEditingCellEventArgs) => void >()

CellEdited subscription event

CellEditing
Default value : new SubscriptionEvent< (s: XamGridModel, e: EditingCellEventArgs) => void >()

CellEditing subscription event

CellEnteredEditMode
Default value : new SubscriptionEvent< (s: XamGridModel, e: EditingCellEventArgs) => void >()
CellEnteringEditMode
Default value : new SubscriptionEvent< (s: XamGridModel, e: BeginEditingCellEventArgs) => void >()
CellExitedEditMode
Default value : new SubscriptionEvent< (s: XamGridModel, e: CellExitedEditingEventArgs) => void >()
CellExitingEditMode
Default value : new SubscriptionEvent< (s: XamGridModel, e: ExitEditingCellEventArgs) => void >()
CellSelectionChanged
Default value : new SubscriptionEvent< (s: XamGridModel, e: any) => void >()

CellSelectionChanged subscription event

Static CellStyleProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'CellStyle', null, null )

CellStyleProperty dependency property

Static ChildBandHeaderHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty('ChildBandHeaderHeight', null, null)

ChildBandHeaderHeightProperty dependency property

Static ChildBandHeaderStyleProperty
Type : DependencyProperty
Default value : new DependencyProperty('ChildBandHeaderStyle', null, null)

ChildBandHeaderStyleProperty dependency property

ColumnFiltered
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()

ColumnFiltered subscription event

ColumnFixedStateChanged
Default value : new SubscriptionEvent< (s: XamGridModel, e: any) => void >()
Static ColumnLayoutHeaderVisibilityProperty
Type : DependencyProperty
Default value : new DependencyProperty('ColumnLayoutHeaderVisibility', null, null)

ColumnLayoutHeaderVisibilityProperty dependency property

ColumnMovingSettings
Default value : new ColumnMovingSettings()
ColumnResized
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()
ColumnResizing
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()
ColumnResizingSettings
Default value : new ColumnResizingSettings()
ColumnSelectionChanged
Default value : new SubscriptionEvent< (s: XamGridModel, e: any) => void >()

ColumnSelectionChanged subscription event

Static ColumnsFooterTemplateProperty
Type : DependencyProperty
Default value : new DependencyProperty('ColumnsFooterTemplate', null, null)

ColumnsFooterTemplateProperty dependency property

ColumnSorted
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()
ColumnSorting
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()
Private Readonly columnTypes
Type : Map<string | XamGridColumnType>
Default value : new Map< string, XamGridColumnType >()

Stores information about column types.

ColumnWidth
Type : ColumnWidth
Decorators :
@Dependency(XamGridModel.ColumnWidthProperty)

Gets or sets the column width

Static ColumnWidthProperty
Type : DependencyProperty
Default value : new DependencyProperty('ColumnWidth', ColumnWidth.InitialAuto, null)

ColumnWidthProperty dependency property

contextActiveCell
Type : function

Mobilize callback to set the ActiveCell when the igx-grid is rendered

Public CurrentEditCell
Type : XamGridCell

Keeps the current edit cell

Public CurrentEditRow
Type : XamGridRow

Keeps the current edit row

Private dataColumnInfoAdjusted
Default value : false

Flag to determine if the types of the column were adjusted based on new objects added to the items source

Static DeleteKeyActionProperty
Type : DependencyProperty
Default value : new DependencyProperty('DeleteKeyAction', null, null)

DeleteKeyActionProperty dependency property

EditingSettings
Default value : new EditingSettings()
editorTemplateLoading
Default value : false

Flag to manage when the editor template is loaded

FilteringSettings
Default value : new FilteringSettings()
FixedColumnSettings
Default value : new FixedColumnSettings()
Static FixedRowSeparatorStyleProperty
Type : DependencyProperty
Default value : new DependencyProperty('FixedRowSeparatorStyle', null, null)

FixedRowSeparatorStyleProperty dependency property

Static FooterRowHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty('FooterRowHeight', null, null)

FooterRowHeightProperty dependency property

Static FooterStyleProperty
Type : DependencyProperty
Default value : new DependencyProperty('FooterStyle', null, null)

FooterStyleProperty dependency property

FooterVisibility
Type : boolean
Decorators :
@Dependency(XamGridModel.FooterVisibilityProperty)

Gets or sets the footer visibility

Static FooterVisibilityProperty
Type : DependencyProperty
Default value : new DependencyProperty('FooterVisibility', false, null)

FooterVisibilityProperty dependency property

gridComponentInstance
Type : any
Default value : null

Custom Mobilize property to access the XamGridComponent.

Static HeaderRowHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty('HeaderRowHeight', null, null)

HeaderRowHeightProperty dependency property

HeaderStyle
Type : RuntimeStyleInfo
Decorators :
@Dependency(XamGridModel.HeaderStyleProperty)

Gets or sets the header style

Static HeaderStyleProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'HeaderStyle', null, XamGridModel.TransformStyleCallback )

HeaderStyleProperty dependency property

HeaderStylePropertyToApply
Type : any
Default value : {}

headerStyleProperty css properties object used to apply

Static HeaderTemplateProperty
Type : DependencyProperty
Default value : new DependencyProperty('HeaderTemplate', null, null)

HeaderTemplateProperty dependency property

Static HeaderTextHorizontalAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty('HeaderTextHorizontalAlignment', null, null)

HeaderTextHorizontalAlignmentProperty dependency property

Static HeaderTextVerticalAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty('HeaderTextVerticalAlignment', null, null)

HeaderTextVerticalAlignmentProperty dependency property

HeaderVisibility
Type : any
Default value : 'visible'
Static HeaderVisibilityProperty
Type : DependencyProperty
Default value : new DependencyProperty('HeaderVisibility', null, null)

HeaderVisibilityProperty dependency property

Static IndentationProperty
Type : DependencyProperty
Default value : new DependencyProperty('Indentation', null, null)

IndentationProperty dependency property

InitializeRow
Default value : new SubscriptionEvent< (s: XamGridModel, e: InitializeRowEventArgs) => void >()
IsAlternateRowsEnabled
Type : boolean
Decorators :
@Dependency(XamGridModel.IsAlternateRowsEnabledProperty)

Gets or sets the IsAlternateRowsEnabled property

Static IsAlternateRowsEnabledProperty
Type : DependencyProperty
Default value : new DependencyProperty('IsAlternateRowsEnabled', false, null)

IsAlternateRowsEnabledProperty dependency property

isEditableOnAdd
Type : boolean
Static IsTouchSupportEnabledProperty
Type : DependencyProperty
Default value : new DependencyProperty('IsTouchSupportEnabled', null, null)

IsTouchSupportEnabledProperty dependency property

Public ItemsSourceAsPagedCollection
Type : IPagedCollectionView
Default value : null

Property containing a reference as a IPagedCollection or null

Static ItemsSourceProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'ItemsSource', null, XamGridModel.itemsSourceCallback )

ItemsSourceProperty dependency property

Static KeyboardNavigationProperty
Type : DependencyProperty
Default value : new DependencyProperty('KeyboardNavigation', null, null)

KeyboardNavigationProperty dependency property

KeyDown
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()
Inherited from UIElement
Defined in UIElement:683

KeyDown subscription event

Loaded
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()
Inherited from FrameworkElement

Loaded subscription event

Static MaxDepthProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'MaxDepth', null, null )

MaxDepthProperty dependency property

Static MinimumRowHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty('MinimumRowHeight', null, null)

MinimumRowHeightProperty dependency property

PageIndexChanged
Default value : new SubscriptionEvent< (s: XamGridModel, e: PageChangedEventArgs) => void >()
PageIndexChanging
Default value : new SubscriptionEvent< (s: XamGridModel, e: CancellablePageChangingEventArgs) => void >()
PagerSettings
Default value : new PagerSettings()
PreventClearActiveCell
Default value : false

Flag to prevent clearing Active Cell when CollectionChnged is triggered.

Rendered
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()

Rendered subscription event

RowAdded
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()
RowDeleted
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()
RowEnteredEditMode
Default value : new SubscriptionEvent< (s: XamGridModel, e: EditingRowEventArgs) => void >()
RowExitedEditMode
Default value : new SubscriptionEvent< (s: XamGridModel, e: EditingRowEventArgs) => void >()
Static RowHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'RowHeight', null, null )

RowHeightProperty dependency property

RowHover
Type : RowHoverType
Decorators :
@Dependency(XamGridModel.RowHoverProperty)

Gets or sets the row hover

Static RowHoverProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'RowHover', RowHoverType.Cell, null )

RowHoverProperty dependency property

RowsCollectionChanged
Default value : new SubscriptionEvent< (s: XamGridModel, e: any) => void >()

RowsCollectionChanged subscription event

RowSelectionChanged
Default value : new SubscriptionEvent< (s: XamGridModel, e: any) => void >()

RowSelectionChanged subscription event

RowSelectorSettings
Default value : new RowSelectorSettings()
ScrolledCellIntoView
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(cell: XamGridCell) => void>()

ScrolledCellIntoView subscription event

SelectedColumnIndex
Type : any

Gets or sets the selected column index

SelectedIndex
Type : any

SelectedIndex

SelectedItems
Type : ObservableCollection<any>
Default value : new ObservableCollection<any>()

SelectedItems

Public SelectedRow
Type : any
Decorators :
@Dependency(XamGridModel.SelectedRowProperty)

Selected row property

Static SelectedRowProperty
Default value : new DependencyProperty( 'SelectedRow', null, null )

SelectedRowProperty dependency property.

SelectedRowsCollectionChanged
Type : SubscriptionEvent<any>
Default value : new SubscriptionEvent<any>()
SortingSettings
Default value : new SortingSettings()
Unloaded
Default value : new SubscriptionEvent<(s: XamGridModel, e: any) => void>()
Inherited from FrameworkElement

Unloaded subscription event

virtualHeight
Type : string | null
Default value : '100%'

Sets the grid height to limit how many rows are rendered accepts null value, which will render all rows in the DOM with no scrollbar

avoidTemplateModelResolution
Type : boolean
Inherited from Control
Defined in Control:431

Flag to determine if the default template must used instead of the dynamic template when resolving the component to use to render the current control.

When a control model has a control template associated, the component of the control template is used to render the current model

Public Background
Type : Brush
Decorators :
@Dependency(Control.BackgroundProperty)
Inherited from Control
Defined in Control:255

Gets or sets the background property

Static BackgroundProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Background', null, null )
Inherited from Control
Defined in Control:45

BackgroundProperty dependency property

Static BorderBrushProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'BorderBrush', null, null )
Inherited from Control
Defined in Control:59

BorderBrushProperty dependency property

Static BorderThicknessProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'BorderThickness', null, null )
Inherited from Control
Defined in Control:72

BorderThicknessProperty dependency property

Static CharacterSpacingProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'CharacterSpacing', null, null )
Inherited from Control
Defined in Control:85

CharacterSpacingProperty dependency property

Public DefaultStyleKey
Type : unknown
Inherited from Control
Defined in Control:367
Static DefaultStyleKeyProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'DeafaultStyleKey', null, null )
Inherited from Control
Defined in Control:98

DefaultStyleKeyProperty dependency property

Public FontFamily
Type : any
Decorators :
@Dependency(Control.FontFamilyProperty)
Inherited from Control
Defined in Control:282

Gets or sets the font family

Static FontFamilyProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontFamily', null, null )
Inherited from Control
Defined in Control:111

FontFamilyProperty dependency property

Public FontSize
Type : number
Decorators :
@Dependency(Control.FontSizeProperty)
Inherited from Control
Defined in Control:291

Gets or sets the font size

Static FontSizeProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontSize', null, null )
Inherited from Control
Defined in Control:124

FontSizeProperty dependency property

Public FontStretch
Type : any
Decorators :
@Dependency(Control.FontStretchProperty)
Inherited from Control
Defined in Control:300

Gets or sets the font stretch

Static FontStretchProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontStretch', null, null )
Inherited from Control
Defined in Control:137

FontStretchProperty dependency property

Public FontStyle
Type : any
Decorators :
@Dependency(Control.FontStyleProperty)
Inherited from Control
Defined in Control:309

Gets or sets the font style

Static FontStyleProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontStyle', null, null )
Inherited from Control
Defined in Control:150

FontStyleProperty dependency property

Public FontWeight
Type : any
Decorators :
@Dependency(Control.FontWeightProperty)
Inherited from Control
Defined in Control:318

Gets or sets the font weight

Static FontWeightProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FontWeight', null, null )
Inherited from Control
Defined in Control:163

FontWeightProperty dependency property

Public Foreground
Type : any
Decorators :
@Dependency(Control.ForegroundProperty)
Inherited from Control
Defined in Control:327

Gets or sets the foreground

Static ForegroundProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Foreground', null, null )
Inherited from Control
Defined in Control:176

ForegroundProperty dependency property

Public IsEnabledChanged
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from Control
Defined in Control:374

The IsEnabledChanged event

Public IsTabStop
Type : boolean
Decorators :
@Dependency(Control.IsTabStopProperty)
Inherited from Control
Defined in Control:336

Gets or sets the is tab stop property

Static IsTabStopProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'IsTabStop', true, null )
Inherited from Control
Defined in Control:189

IsTabStopProperty dependency property

Public Padding
Type : any
Decorators :
@Dependency(Control.PaddingProperty)
Inherited from Control
Defined in Control:345

Gets or sets the padding

Static PaddingProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Padding', null, null )
Inherited from Control
Defined in Control:202

PaddingProperty dependency property

Public TabIndex
Type : number
Decorators :
@Dependency(Control.TabIndexProperty)
Inherited from Control
Defined in Control:354

Gets or sets the tab index

Static TabIndexProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'TabIndex', 0, null )
Inherited from Control
Defined in Control:215

TabIndexProperty dependency property

TabNavigation
Type : any
Default value : null
Inherited from Control
Defined in Control:365
Static TabNavigationProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'TabNavigation', null, null )
Inherited from Control
Defined in Control:228

TabNavigationProperty dependency property

Public Template
Type : any
Decorators :
@Dependency(Control.TemplateProperty)
Inherited from Control
Defined in Control:363

Gets or sets the template

templateModel
Type : any
Inherited from Control
Defined in Control:418

Model for the control template

This property has value when a control template is assigned to this model

Static TemplateProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'TemplateProperty', null, Control.TemplateCallback )
Inherited from Control
Defined in Control:241

TemplateProperty dependency property

Public ActualHeight
Type : number
Decorators :
@Dependency(FrameworkElement.ActualHeightProperty)
Inherited from FrameworkElement
Static ActualHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'ActualHeight', 0, null )
Inherited from FrameworkElement

ActualHeightProperty dependency property

Public ActualWidth
Type : number
Decorators :
@Dependency(FrameworkElement.ActualWidthProperty)
Inherited from FrameworkElement
Static ActualWidthProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'ActualWidth', 0, null )
Inherited from FrameworkElement

ActualWidthProperty dependency property

allowDataContextAnchestorSet
Default value : true
Inherited from FrameworkElement
Public Clip
Type : any
Decorators :
@Dependency(FrameworkElement.ClipProperty)
Inherited from FrameworkElement

Gets or sets the clip

Public ctxMenuManager
Type : ContextMenuManager
Inherited from FrameworkElement

Instance related to a XamContextMenuComponent

Public CtxMenuOpened
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement

Context menu opened event

Private currentStyleChange
Type : string[]
Inherited from FrameworkElement
Public Cursor
Type : Cursor
Decorators :
@Dependency(FrameworkElement.CursorProperty)
Inherited from FrameworkElement

Gets or sets the cursor

Static CursorProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Cursor', null, null )
Inherited from FrameworkElement

CursorProperty dependency property

Static DataContextProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'DataContext', null, FrameworkElement.DataContextCallback )
Inherited from FrameworkElement

DataContextProperty dependency property

Public FlowDirection
Type : any
Decorators :
@Dependency(FrameworkElement.FlowDirectionProperty)
Inherited from FrameworkElement

Gets or sets the flow direction

Static FlowDirectionProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'FlowDirection', null, null )
Inherited from FrameworkElement

FlowDirectionProperty dependency property

Public hasFocus
Default value : false
Inherited from FrameworkElement

Flag to determine if the framework element has the docus

height
Type : number
Inherited from FrameworkElement
Static Readonly HeightProperty
Default value : new DependencyProperty( 'Height', Number.NaN, FrameworkElement.HeightChangeCallback )
Inherited from FrameworkElement

HeightProperty dependency property

Public HorizontalAlignment
Type : HorizontalAlignment
Decorators :
@Dependency(FrameworkElement.HorizontalAlignmentProperty)
Inherited from FrameworkElement

Gets or sets the horizontal alignment

Static HorizontalAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'HorizontalAlignment', HorizontalAlignment.Stretch, null )
Inherited from FrameworkElement

HorizontalAlignmentProperty dependency property

Public HorizontalContentAlignment
Type : HorizontalAlignment
Decorators :
@Dependency(FrameworkElement.HorizontalContentAlignmentProperty)
Inherited from FrameworkElement

Gets or sets the horizontal content alignment.

Static Readonly HorizontalContentAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'HorizontalContentAlignment', HorizontalAlignment.Center, null )
Inherited from FrameworkElement

HorizontalContentAlignment dependency property.

Protected isDefaultStyleApplied
Type : boolean
Inherited from FrameworkElement

Indicates if the current style is from a default style

Public IsEnabled
Type : boolean
Decorators :
@Dependency(FrameworkElement.IsEnabledProperty)
Inherited from FrameworkElement

Gets value indicating if the control is enabled

/// TODO check property defined in Control instead of framework element

Static Readonly IsEnabledProperty
Default value : new DependencyProperty( 'IsEnabled', true, FrameworkElement.IsEnabledCallback )
Inherited from FrameworkElement

IsEnabledProperty dependency property

Private isFirstTimeLoad
Default value : true
Inherited from FrameworkElement

Flag used to check if it is the first time loading a model or not.

Static LanguageProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Language', null, null )
Inherited from FrameworkElement

LanguageProperty dependency property

Public LayoutUpdated
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement
Public Margin
Type : ThicknessModel
Decorators :
@Dependency(FrameworkElement.MarginProperty)
Inherited from FrameworkElement

Gets or sets the margin

Static MarginProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Margin', null, null )
Inherited from FrameworkElement

MarginProperty dependency property

Public maxHeight
Type : number
Decorators :
@Dependency(FrameworkElement.MaxHeightProperty)
Inherited from FrameworkElement

Gets or sets max height

Static MaxHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'MaxHeight', 0, null )
Inherited from FrameworkElement

MaxHeightProperty dependency property

Public maxWidth
Type : number
Decorators :
@Dependency(FrameworkElement.MaxWidthProperty)
Inherited from FrameworkElement

Gets or sets the max width

Static MaxWidthProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'MaxWidth', 0, null )
Inherited from FrameworkElement

MaxWidthProperty dependency property

Public minHeight
Type : number
Decorators :
@Dependency(FrameworkElement.MinHeightProperty)
Inherited from FrameworkElement

Gets or sets the min height

Static MinHeightProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'MinHeight', 0, null )
Inherited from FrameworkElement

MinHeightProperty dependency property

Public minWidth
Type : number
Decorators :
@Dependency(FrameworkElement.MinWidthProperty)
Inherited from FrameworkElement

Gets or sets the min width

Static MinWidthProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'MinWidth', 0, null )
Inherited from FrameworkElement

MinWidthProperty dependency property

Public name
Type : string
Default value : ''
Inherited from FrameworkElement
Static NameProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Name', null, null )
Inherited from FrameworkElement

NameProperty dependency property

Private parent
Type : FrameworkElement
Default value : null
Inherited from FrameworkElement
parentChangeHandler
Type : function
Inherited from FrameworkElement
Public resources
Type : ResourceDictionary
Default value : new ResourceDictionary()
Inherited from FrameworkElement

Resources property

Public SizeChanged
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement
Private sizeChangedPendingTimeout
Type : any
Inherited from FrameworkElement
Public Style
Type : RuntimeStyleInfo
Decorators :
@Dependency(FrameworkElement.StyleProperty)
Inherited from FrameworkElement

Gets or sets the style

Static StyleProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Style', null, FrameworkElement.StyleCallback )
Inherited from FrameworkElement

StyleProperty dependency property

Public Tag
Type : any
Decorators :
@Dependency(FrameworkElement.TagProperty)
Inherited from FrameworkElement

Gets or sets the tag

Static TagProperty
Default value : new DependencyProperty('Tag', null, null)
Inherited from FrameworkElement

TagProperty dependency property

Public tooltip
Type : ToolTipModel
Default value : null
Inherited from FrameworkElement

Instance related to a tooltip component for this control

Public ToolTipSet
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from FrameworkElement

ToolTipSet event

Public VerticalAlignment
Type : VerticalAlignment
Decorators :
@Dependency(FrameworkElement.VerticalAlignmentProperty)
Inherited from FrameworkElement

Gets or sets the vertical alignment

Static VerticalAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'VerticalAlignment', VerticalAlignment.Stretch, null )
Inherited from FrameworkElement

VerticalAlignmentProperty dependency property

Public VerticalContentAlignment
Type : VerticalAlignment
Decorators :
@Dependency(FrameworkElement.VerticalContentAlignmentProperty)
Inherited from FrameworkElement

Gets or sets the vertical content alignment.

Static VerticalContentAlignmentProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'VerticalContentAlignment', VerticalAlignment.Center, null )
Inherited from FrameworkElement

VerticalContentAlignment dependency property.

Public Width
Type : number
Decorators :
@Dependency(FrameworkElement.WidthProperty)
Inherited from FrameworkElement

Gets or sets the width

Static WidthProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Width', Number.NaN, FrameworkElement.WidthChangeCallback )
Inherited from FrameworkElement

WidthProperty dependency property

Private __internalVisibility
Type : boolean
Default value : true
Inherited from UIElement
Defined in UIElement:289
Public AllowDrop
Type : boolean
Decorators :
@Dependency(UIElement.AllowDropProperty)
Inherited from UIElement
Defined in UIElement:279

Gets or sets the allow drop value

Static AllowDropProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'AllowDrop', false, null )
Inherited from UIElement
Defined in UIElement:52

AllowDropProperty dependency property

Public CacheMode
Type : any
Decorators :
@Dependency(UIElement.CacheModeProperty)
Inherited from UIElement
Defined in UIElement:287

Gets or sets the cache mode value

Static CacheModeProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'CacheMode', null, null )
Inherited from UIElement
Defined in UIElement:65

CacheModeProperty dependency property

capturedMoveHandler
Type : function
Inherited from UIElement
Defined in UIElement:339
capturedUpHandler
Type : function
Inherited from UIElement
Defined in UIElement:338
Static ClipProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Clip', null, null )
Inherited from UIElement
Defined in UIElement:78

ClipProperty dependency property

Private customCSSClasses
Type : string
Default value : ''
Inherited from UIElement
Defined in UIElement:271

Custom property to save CSS classes that need to be applied to the control

Static EffectProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Effect', null, null )
Inherited from UIElement
Defined in UIElement:91

EffectProperty dependency property

Public GotFocus
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: any) => void>()
Inherited from UIElement
Defined in UIElement:229
Private hasAutoColumnGridParent
Type : boolean
Default value : false
Inherited from UIElement
Defined in UIElement:262

Custom property to know if control is inside grid with auto columns

Public IsHitTestVisible
Type : boolean
Default value : false
Decorators :
@Dependency(UIElement.IsHitTestVisibleProperty)
Inherited from UIElement
Defined in UIElement:322

IsHitTestVisible property

Static IsHitTestVisibleProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'IsHitTestVisible', null, null )
Inherited from UIElement
Defined in UIElement:104

IsHitTestVisibleProperty dependency property

Public KeyUp
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: any) => void>()
Inherited from UIElement
Defined in UIElement:227
Public LostFocus
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(sender: any, e: any) => void>()
Inherited from UIElement
Defined in UIElement:231
Public MouseEnter
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: any) => MouseEventArgs>()
Inherited from UIElement
Defined in UIElement:213
Public MouseLeave
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: any) => MouseEventArgs>()
Inherited from UIElement
Defined in UIElement:215
Public MouseLeftButtonDown
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:207
Public MouseLeftButtonUp
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:217
Public MouseMove
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:223
Public MouseRightButtonDown
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:210
Public MouseRightButtonUp
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(s: any, e: MouseEventArgs) => void>()
Inherited from UIElement
Defined in UIElement:220
Public Name
Type : string
Default value : ''
Inherited from UIElement
Defined in UIElement:242

Name property

Public OnModelChange
Type : function
Inherited from UIElement
Defined in UIElement:42

On model change handler reference

Public Opacity
Type : number
Decorators :
@Dependency(UIElement.OpacityProperty)
Inherited from UIElement
Defined in UIElement:253

Gets or sets the opacity value

Static OpacityMaskProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'OpacityMask', null, null )
Inherited from UIElement
Defined in UIElement:117

OpacityMaskProperty dependency property

Static OpacityProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Opacity', 1, null )
Inherited from UIElement
Defined in UIElement:130

OpacityProperty dependency property

Static ProjectionProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Projection', null, null )
Inherited from UIElement
Defined in UIElement:143

ProjectionProperty dependency property

Public RenderSize
Type : Size
Decorators :
@Dependency(UIElement.RenderSizeProperty)
Inherited from UIElement
Defined in UIElement:297

Gets the final render size of a UIElement.

Static RenderSizeProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'RenderSize', new Size(0, 0), null )
Inherited from UIElement
Defined in UIElement:156

RenderSizeProperty dependency property

Public RenderTransform
Type : any
Decorators :
@Dependency(UIElement.RenderTransformProperty)
Inherited from UIElement
Defined in UIElement:314

Gets or sets the render transform

Public RenderTransformOrigin
Type : any
Decorators :
@Dependency(UIElement.RenderTransformOriginProperty)
Inherited from UIElement
Defined in UIElement:305

Gets or sets the render transform origin

Static RenderTransformOriginProperty
Type : DependencyProperty
Default value : new DependencyProperty('RenderTransformOrigin', null, null)
Inherited from UIElement
Defined in UIElement:169

RenderTransformOriginProperty dependency property

Static RenderTransformProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'RenderTransform', null, null )
Inherited from UIElement
Defined in UIElement:179

RenderTransformProperty dependency property

Public Spin
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent<(sender: any, e: any) => void>()
Inherited from UIElement
Defined in UIElement:233
Static UseLayoutRoundingProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'UseLayoutRounding', true, null )
Inherited from UIElement
Defined in UIElement:192

UseLayoutRoundingProperty dependency property

Static VisibilityProperty
Default value : new DependencyProperty('Visibility', true, null)
Inherited from UIElement
Defined in UIElement:205

VisibilityProperty dependency property

Protected bindingExpressions
Default value : new SimpleDictionary< string, BindingExpression >()
Inherited from DependencyObject
Public BindingValidationError
Default value : new SubscriptionEvent< (sender: any, e: BindingValidationErrorEventArgs) => void >()
Inherited from DependencyObject

Event for validation errors

Public change
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from DependencyObject

Infrastructure event for notifying event changes

Public Dispatcher
Type : Dispatcher
Default value : Dispatcher.GetDispatcher()
Inherited from DependencyObject
isEnableSetPropertiesRegistry
Type : boolean
Default value : true
Inherited from DependencyObject

Flag which indicates if the dependency property set mechanism is enable

Public IsInitializingBindings
Type : boolean
Default value : false
Inherited from DependencyObject

Property to determine if bindings are being initialized

previousValidationMessage
Type : string
Default value : ''
Inherited from DependencyObject
Protected properties
Type : object
Default value : {}
Inherited from DependencyObject
Private setPropertiesRegistry
Type : Map<string | boolean>
Default value : new Map()
Inherited from DependencyObject

Registry with dependencies properties which has been set

validationerr
Default value : false
Inherited from DependencyObject
validationMessagesStack
Type : Array<>
Default value : []
Inherited from DependencyObject

Keeps a queue of validation messages registered on the current Dependency Object

Methods

Private ActiveLifeCycle
ActiveLifeCycle(cell: CellBase)

Run the active life cycle of the activeNode process

Parameters :
Name Type Optional
cell CellBase No
Returns : any
Public addColumn
addColumn(column: XamGridColumnModel)

addColumn

Parameters :
Name Type Optional
column XamGridColumnModel No
Returns : void
addVisualColumn
addVisualColumn(column: XamGridColumnModel)
Parameters :
Name Type Optional
column XamGridColumnModel No
Returns : void
Public adjustColumnTypesBasedOnNewData
adjustColumnTypesBasedOnNewData()

Adjust column DataType properties based on new data

Returns : void
ApplyItemSource
ApplyItemSource(itemSource: Iterable<any>)

Applies the Item source

Parameters :
Name Type Optional
itemSource Iterable<any> No
Returns : void
Public CellDoubleClickHandler
CellDoubleClickHandler(event: any)

Fire CellDoubleClickHandler

Parameters :
Name Type Optional
event any No
Returns : void
Public CellSelectionChangeHandler
CellSelectionChangeHandler(event: any)

fire CellSelectionChangeHandler

Parameters :
Name Type Optional
event any No
Returns : void
Public ClearSelectedRows
ClearSelectedRows()

Clears selected rows.

Returns : void
Public ColumnSelectionChangeHandler
ColumnSelectionChangeHandler(event: any)

Fire ColumnSelectionChangeHandler

Parameters :
Name Type Optional
event any No
Returns : void
Public Dispose
Dispose(disposing?: boolean)

Dispose

Parameters :
Name Type Optional
disposing boolean Yes
Returns : void
Public ExitEditMode
ExitEditMode(cancel: boolean)

ExitEditMode

Parameters :
Name Type Optional
cancel boolean No
Returns : void
Public ExitEditModeInternal
ExitEditModeInternal(cancel: boolean)

ExitEditModeInternal

Parameters :
Name Type Optional
cancel boolean No
Returns : void
Public getColumns
getColumns()

getColumns

{ColumnBaseCollection}

Public GetColumnType
GetColumnType(columnName: string)

Returns the column data type associated with the given column name.

Parameters :
Name Type Optional
columnName string No
Returns : XamGridColumnType

{string}

Public HasColumnType
HasColumnType(columnName: string)

Returns true if the given column name has an associated data type, false otherwise.

Parameters :
Name Type Optional
columnName string No
Returns : boolean

{boolean}

isInEditMode
isInEditMode(cell: CellBase)
Parameters :
Name Type Optional
cell CellBase No
Returns : void
Private Static itemsSourceCallback
itemsSourceCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)

Triggers a special model change event when ItemsSource changes.

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Public KeyDownHandler
KeyDownHandler(event: any)

KeyDownHandler

Parameters :
Name Type Optional
event any No
Returns : void
Public NotifyDataUpdate
NotifyDataUpdate()

Notify this model of a data update.

Returns : void
OnActiveCellChanged
OnActiveCellChanged()
Returns : void
OnActiveCellChanging
OnActiveCellChanging(e: ActiveCellChangingEventArgs)
Parameters :
Name Type Optional
e ActiveCellChangingEventArgs No
Returns : void
Public OnGotFocus
OnGotFocus(args: RoutedEventArgs)
Inherited from Control
Defined in Control:1294

On Got Focus handler for XamGrid

Parameters :
Name Type Optional
args RoutedEventArgs No
Returns : void
Public OnPropertyChanged
OnPropertyChanged(name: string)

OnPropertyChanged

Parameters :
Name Type Optional
name string No
Returns : void
Public RowSelectionChangeHandler
RowSelectionChangeHandler(event: any)

Fire RowSelectionChangeHandler

Parameters :
Name Type Optional
event any No
Returns : void
Public ScrollCellIntoView
ScrollCellIntoView(cell: CellBase)

ScrollCellIntoView

Parameters :
Name Type Optional
cell CellBase No
Returns : void
Public ScrollIntoView
ScrollIntoView(...args: any[])

ScrollIntoView

Parameters :
Name Type Optional
args any[] No
Returns : void
Public SelectRow
SelectRow(row: XamGridRow)

A callback function to handle row selection

Parameters :
Name Type Optional
row XamGridRow No
Returns : void
SetActiveCell
SetActiveCell(cell: CellBase, alignment: CellAlignment, action: InvokeAction, allowSelection: boolean, setFocus: boolean, scrollIntoView: boolean)

Set the active Cell for the xamGrid, trigger events for OnActiveCellChanging and OnActiveCellChanged

Parameters :
Name Type Optional
cell CellBase No
alignment CellAlignment No
action InvokeAction No
allowSelection boolean No
setFocus boolean No
scrollIntoView boolean No
Returns : any
Private setColumnInfo
setColumnInfo(column: XamGridColumnModel)

Sets the ColumnLayout for the row

Parameters :
Name Type Optional
column XamGridColumnModel No
Returns : void
Public SetColumnType
SetColumnType(columnName: string, type: XamGridColumnType)

Sets the data type associated with a column name. Valid examples of column types are:

  • 'int'
  • 'decimal'
  • 'int?'
  • 'Nullable<int>'
  • etc.
Parameters :
Name Type Optional
columnName string No
type XamGridColumnType No
Returns : void
Static TransformStyleCallback
TransformStyleCallback(sender: XamGridModel, args: DependencyPropertyChangedEventArgs)

Callback function to transform style object.

Parameters :
Name Type Optional
sender XamGridModel No
args DependencyPropertyChangedEventArgs No
Returns : void
Public UnselectRow
UnselectRow(row: XamGridRow)

A callback function to handle the unselection of rows

Parameters :
Name Type Optional
row XamGridRow No
Returns : void
ApplyTemplate
ApplyTemplate()
Inherited from Control
Defined in Control:433
Returns : any
Public Focus
Focus()
Inherited from Control
Defined in Control:403

Focus control

Returns : void
Public GetTemplateChild
GetTemplateChild(name: string)
Inherited from Control
Defined in Control:386

Gets a control model defined inside the control template model (if assigned)

Parameters :
Name Type Optional
name string No
Returns : DependencyObject

{DependencyObject}

Protected loadModels
loadModels()
Inherited from Control
Defined in Control:526

Loads the model for the child elements defined in component.

Returns : void
OnKeyDown
OnKeyDown(args: KeyEventArgs)
Inherited from Control
Defined in Control:442
Parameters :
Name Type Optional
args KeyEventArgs No
Returns : void
OnKeyUp
OnKeyUp(sender: any, args?: KeyEventArgs)
Inherited from Control
Defined in Control:443
Parameters :
Name Type Optional
sender any No
args KeyEventArgs Yes
Returns : void
OnLostFocus
OnLostFocus(args: RoutedEventArgs)
Inherited from Control
Defined in Control:459

OnLostFocus handler

Parameters :
Name Type Optional
args RoutedEventArgs No
Returns : void
OnMouseEnter
OnMouseEnter(a0?, args?: any)
Inherited from Control
Defined in Control:437
Parameters :
Name Type Optional
a0 Yes
args any Yes
Returns : any
OnMouseLeave
OnMouseLeave(a0?)
Inherited from Control
Defined in Control:438
Parameters :
Name Optional
a0 Yes
Returns : any
OnMouseLeftButtonDown
OnMouseLeftButtonDown(a0?)
Inherited from Control
Defined in Control:439
Parameters :
Name Optional
a0 Yes
Returns : any
OnMouseLeftButtonUp
OnMouseLeftButtonUp(a0?)
Inherited from Control
Defined in Control:441
Parameters :
Name Optional
a0 Yes
Returns : any
OnMouseMove
OnMouseMove(a0?)
Inherited from Control
Defined in Control:440
Parameters :
Name Optional
a0 Yes
Returns : any
Public OnTemplateChanged
OnTemplateChanged(sender: any, args: DependencyPropertyChangedEventArgs)
Inherited from Control
Defined in Control:481

Operation to apply when changing control template

Parameters :
Name Type Optional
sender any No
args DependencyPropertyChangedEventArgs No
Returns : void
OnTextChanged
OnTextChanged(sender: any, args?: any)
Inherited from Control
Defined in Control:471

OnTextChanged handler

Parameters :
Name Type Optional
sender any No
args any Yes
Returns : void
Static TemplateCallback
TemplateCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from Control
Defined in Control:510

Callback for the template changed property

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Protected tryApplyStyleFromParentOrDefault
tryApplyStyleFromParentOrDefault()
Inherited from FrameworkElement

Tries to apply style from parent or from default

Returns : void
Protected tryGetDefaultThemeStyle
tryGetDefaultThemeStyle()
Inherited from Control
Defined in Control:553

Tries to resolve style from default theme

Returns : any
Public AfterContentChecked
AfterContentChecked()
Inherited from FrameworkElement

Angular Lifecycle Hooks

Returns : void
Public AfterContentInit
AfterContentInit()
Inherited from FrameworkElement

Angular Lifecycle Hook

Returns : void
Public AfterViewChecked
AfterViewChecked()
Inherited from FrameworkElement

Angular Lifecycle Hooks

Returns : void
Public AfterViewInit
AfterViewInit()
Inherited from FrameworkElement

Angular Lifecycle Hook. According to SL Documentation LayoutUpdated is the last object lifetime event to occur in the sequence before a control is ready for interaction. A setTimeout is set to ensure that it is triggered after everything is resolved.

Returns : void
Public CleanupBindingSubscriptions
CleanupBindingSubscriptions()
Inherited from FrameworkElement

Clean up any subscription created for user bindings

Returns : void
Static DataContextCallback
DataContextCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

DataContext Callback Executed when the Width changes

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Public DoCheck
DoCheck()
Inherited from FrameworkElement

Angular Lifecycle Hooks

Returns : void
Public FindName
FindName(name: string)
Inherited from FrameworkElement

Find an object by its Name.

Parameters :
Name Type Optional
name string No
Returns : unknown

{unknown}

Public fireLoaded
fireLoaded()
Inherited from FrameworkElement

Fire Loaded event. The event is fired only once, even if fireLoaded() is called multiple times.

Returns : void
Public getApplicationResource
getApplicationResource(key: string, ...properties: string[])
Inherited from FrameworkElement

Retrieves a resource with the given key or with the given property path

Paths are just a collection of properties to be identified. Also static fields could be accessed using object instances.

@example let obj = tmp.getApplicationResource('reskey', 'P1', 'P2')

Parameters :
Name Type Optional Description
key string No

the key of the resource

properties string[] No

a collection of property paths

Example :
let obj = tmp.getApplicationResource(&#39;reskey&#39;, &#39;P1&#39;, &#39;P2&#39;)
Returns : any

{any} the resulting data element

GetBindingExpression
GetBindingExpression(dependencyProperty: DependencyProperty)
Inherited from FrameworkElement
Parameters :
Name Type Optional
dependencyProperty DependencyProperty No
Returns : any
Public getResourceByKey
getResourceByKey(key: string)
Inherited from FrameworkElement

Gets the specific resource by the given key

Parameters :
Name Type Optional
key string No
Returns : unknown

{unknown}

Static HeightChangeCallback
HeightChangeCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

HeightChange Callback Executed when the Height changes

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Protected initProperties
initProperties()
Inherited from FrameworkElement

Initialize the child elements properties of the component in code behind.

Returns : void
Private innerGetChild
innerGetChild(idx: number)
Inherited from FrameworkElement

Gets the child number idx from this FrameworkElement.

Parameters :
Name Type Optional
idx number No
Returns : DependencyObject

{DependencyObject}

Private innerGetChildrenCount
innerGetChildrenCount()
Inherited from FrameworkElement

Gets the number of children on this FrameworkElement.

Returns : number

{number}

Private innerGetChildrenParent
innerGetChildrenParent(prop: string)
Inherited from FrameworkElement

Gets the parent from which children should be taken from.

Parameters :
Name Type Optional
prop string No
Returns : FrameworkElement

{FrameworkElement}

Static IsEnabledCallback
IsEnabledCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

IsEnabled dependency property callback

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
MeasureOverride
MeasureOverride(availableSize: Size)
Inherited from FrameworkElement

Measure override method NOTE: We are not supporting this functionality in angular, this implementation is meant only to avoid runtime exceptions, but any code that relies on MeasureOverride should be review and analyze for manual changes

Parameters :
Name Type Optional
availableSize Size No
Returns : Size

{Size}

Public OnApplyTemplate
OnApplyTemplate()
Inherited from FrameworkElement

This method is involved in a setTimeout call when a control template is assigned to the current model

Returns : void
Public OnChanges
OnChanges()
Inherited from FrameworkElement

Angular Lifecycle Hooks

Returns : void
Protected OnDataContextCallback
OnDataContextCallback(args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

Callback action for DataContext property changes

Parameters :
Name Type Optional
args DependencyPropertyChangedEventArgs No
Returns : void
Public OnDestroy
OnDestroy()
Inherited from FrameworkElement
Returns : void
Public OnInit
OnInit()
Inherited from FrameworkElement

Angular Lifecycle Hook

Returns : void
Public OnIsEnabledChanged
OnIsEnabledChanged(args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

On IsEnabled changed handler

Parameters :
Name Type Optional
args DependencyPropertyChangedEventArgs No
Returns : void
OpenCtxMenu
OpenCtxMenu(menu: ContextMenuManager)
Inherited from FrameworkElement

Opens an instance of the XamContextMenu This is declared here because it can be set as an attached property and the component should know when it has a XamContextMenu setted to be displayed.

Parameters :
Name Type Optional
menu ContextMenuManager No
Returns : void
Public RaiseSizeChangedEvent
RaiseSizeChangedEvent()
Inherited from FrameworkElement

Raise the SizeChanged event

Returns : void
Public RecreateInvalidBindings
RecreateInvalidBindings()
Inherited from FrameworkElement

Calling CleanupBindingSubscriptions will set bindingExpression into an invalid state, the expressions and bindings still might persist (if the model is not destroyed), yet the subscriptions were cleaned, if this model is re-bind to a new angular component previous bindings and bindingExpressions will required to be recreated to work properly.

This happens when the angular component is destroyed but the model still persists, like when an *ngIf is used to hide an item in the DOM, yet the model instance still persist until it gets visible again, the binding and bindingExpression will be the same but their subscriptions are gone.

Returns : void
Public refreshBindings
refreshBindings()
Inherited from FrameworkElement

Refresh element binding values

Returns : void
Private scheduleFiringSizeChanged
scheduleFiringSizeChanged()
Inherited from FrameworkElement

Schedules executing the SizeChanged event

Returns : void
Private setDataContextFromAnchestor
setDataContextFromAnchestor(parent: any)
Inherited from FrameworkElement

Sets the datacontext from anchestor when was not directly set to property

Parameters :
Name Type Optional
parent any No
Returns : void
SetTooltipToModel
SetTooltipToModel(tooltip: ToolTipModel)
Inherited from FrameworkElement

Set tooltip component

Parameters :
Name Type Optional
tooltip ToolTipModel No
Returns : void
Static StyleCallback
StyleCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

StyleCallback

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
UpdateLayout
UpdateLayout()
Inherited from UIElement
Defined in UIElement:541

Updates the layout

Returns : void
Static WidthChangeCallback
WidthChangeCallback(sender: DependencyObject, args: DependencyPropertyChangedEventArgs)
Inherited from FrameworkElement

WidthChange Callback Executed when the Width changes

Parameters :
Name Type Optional
sender DependencyObject No
args DependencyPropertyChangedEventArgs No
Returns : void
Public Arrange
Arrange(obj: any)
Inherited from UIElement
Defined in UIElement:393

Arrange method

Parameters :
Name Type Optional
obj any No
Returns : void
Public captureMouse
captureMouse()
Inherited from UIElement
Defined in UIElement:368

Captures the mouse events

Returns : boolean
Public Measure
Measure(obj: any)
Inherited from UIElement
Defined in UIElement:404

Measure method

Parameters :
Name Type Optional
obj any No
Returns : any
Public releaseMouseCapture
releaseMouseCapture()
Inherited from UIElement
Defined in UIElement:379
Returns : void
Protected SyncModelWithComponent
SyncModelWithComponent(params: any)
Inherited from UIElement
Defined in UIElement:409
Parameters :
Name Type Optional Default value
params any No null
Returns : void
Public TransformToVisual
TransformToVisual(obj: UIElement)
Inherited from UIElement
Defined in UIElement:354

Transforms to visual

Parameters :
Name Type Optional
obj UIElement No
Returns : any
Public withName
withName(name: string)
Inherited from UIElement
Defined in UIElement:341
Parameters :
Name Type Optional
name string No
Returns : UIElement
Private addRelatedSubscriptionIfRequired
addRelatedSubscriptionIfRequired(event: SubscriptionEvent<any>, theHandler: any, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
event SubscriptionEvent<any> No
theHandler any No
bindingExpression BindingExpression No
Returns : void
Private addSubscriptionForTwoWayBindings
addSubscriptionForTwoWayBindings(dependencyProperty: DependencyProperty, binding: Binding, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
dependencyProperty DependencyProperty No
binding Binding No
bindingExpression BindingExpression No
Returns : void
addsValidationMessage
addsValidationMessage(propKey: Binding | string, message: string)
Inherited from DependencyObject

Adds a new validation message associated to a binding or a property name

Parameters :
Name Type Optional
propKey Binding | string No
message string No
Returns : void
Private beginSubscribeToMultiPropertyPathChanges
beginSubscribeToMultiPropertyPathChanges(context: any, binding: Binding, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
context any No
binding Binding No
dependencyProperty DependencyProperty No
bindingExpression BindingExpression No
Returns : void
Private checkForSubscriptoinToDataErrorInfo
checkForSubscriptoinToDataErrorInfo(currentContext: any, binding: Binding, propertyToSubscribe: string, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
currentContext any No
binding Binding No
propertyToSubscribe string No
bindingExpression BindingExpression No
Returns : void
Public clearValue
clearValue(property: DependencyProperty)
Inherited from DependencyObject

Clears the dependency property value

Parameters :
Name Type Optional
property DependencyProperty No
Returns : void
Equals
Equals(obj: any)
Inherited from DependencyObject

Compares this dependency object agains another object.

Parameters :
Name Type Optional
obj any No
Returns : boolean

{boolean}

GetChild
GetChild(idx: number)
Inherited from DependencyObject

Gets the child element at the index position

Parameters :
Name Type Optional
idx number No
Returns : DependencyObject

{DependencyObject}

GetChildrenCount
GetChildrenCount()
Inherited from DependencyObject

Method o know the amount of children the parent has

Returns : number

{number}

GetHashCode
GetHashCode()
Inherited from DependencyObject

Gets a hash code for this dependency object.

Returns : number

{number}

Public getValue
getValue(property: DependencyProperty)
Inherited from DependencyObject

Gets the value of a dependency property

Parameters :
Name Type Optional
property DependencyProperty No
Returns : any
Private handleErrorsOnContext
handleErrorsOnContext(errorCtxt: INotifyDataErrorInfo, args: DataErrorsChangedEventArgs)
Inherited from DependencyObject

Check and register possible errors in an error context

Parameters :
Name Type Optional
errorCtxt INotifyDataErrorInfo No
args DataErrorsChangedEventArgs No
Returns : void
Public IsPropertySet
IsPropertySet(propertyName: string)
Inherited from DependencyObject

Indicates if the property has been already set.

Parameters :
Name Type Optional
propertyName string No
Returns : any
Private performDataErrorValidationIfRequired
performDataErrorValidationIfRequired(binding: Binding, theBindingContext: any)
Inherited from DependencyObject

Performs validation on model if the model implementes IDataErrorINfo

Parameters :
Name Type Optional
binding Binding No
theBindingContext any No
Returns : void
Private performRemoveValidationIfInValidationError
performRemoveValidationIfInValidationError(binding: Binding)
Inherited from DependencyObject

Performs the remove validation if the InValidationError is true

Parameters :
Name Type Optional
binding Binding No
Returns : void
Public performTargetObjectBindingUpdate
performTargetObjectBindingUpdate(dependencyProperty: DependencyProperty, binding: Binding)
Inherited from DependencyObject

Updates the target object value associated to the binding.

Parameters :
Name Type Optional
dependencyProperty DependencyProperty No
binding Binding No
Returns : void
Private preprocessValue
preprocessValue(property: DependencyProperty, value: any)
Inherited from DependencyObject

Preprocess value to be set to dependency property

Parameters :
Name Type Optional
property DependencyProperty No
value any No
Returns : any
Private recreateSubscriptionsForMultiPropertyBindingPath
recreateSubscriptionsForMultiPropertyBindingPath(currentContext: any, outerContext: any, properties: string[], propertyIndex: number, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression, subscriptionsForCurrentBindingPath: Array<>)
Inherited from DependencyObject
Parameters :
Name Type Optional
currentContext any No
outerContext any No
properties string[] No
propertyIndex number No
dependencyProperty DependencyProperty No
bindingExpression BindingExpression No
subscriptionsForCurrentBindingPath Array<> No
Returns : void
Private registerSetPropertyIfRequired
registerSetPropertyIfRequired(name: string)
Inherited from DependencyObject

Register set property if required

Parameters :
Name Type Optional
name string No
Returns : void
Private removeSubscriptionsForMultiPropertyBindingPath
removeSubscriptionsForMultiPropertyBindingPath(subscriptionsForCurrentBindingPath: [], propertyIndex: number)
Inherited from DependencyObject
Parameters :
Name Type Optional
subscriptionsForCurrentBindingPath [] No
propertyIndex number No
Returns : void
removeValidationMessage
removeValidationMessage(propKey: Binding | string)
Inherited from DependencyObject

Removes a validation message associated to a binding or a property name

Parameters :
Name Type Optional
propKey Binding | string No
Returns : void
SetBinding
SetBinding(dependencyProperty: DependencyProperty, binding: Binding)
Inherited from DependencyObject

Sets a binding to the specified property at runtime

Parameters :
Name Type Optional Description
dependencyProperty DependencyProperty No

property to bind

binding Binding No

binding object

Returns : void
Public setValue
setValue(property: DependencyProperty, value: any)
Inherited from DependencyObject

Sets the value for a dependency property

Parameters :
Name Type Optional
property DependencyProperty No
value any No
Returns : void
Public setValueForScopedRegion
setValueForScopedRegion(property: DependencyProperty, value: any, scopedRegionManager: IRegionManager)
Inherited from DependencyObject

Sets the value for a dependency property. This is a workaround to support Scoped Region Managers. A research is required to find out the way to get the application region Manager when scoped region managers are used (when creating the DelayedRegionBehavior, the correct scoped region manager must be passed as an argument).

Parameters :
Name Type Optional
property DependencyProperty No
value any No
scopedRegionManager IRegionManager No
Returns : void
Protected shouldPreventDefaultSourceUpdate
shouldPreventDefaultSourceUpdate(dependencyProperty: DependencyProperty, binding: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
dependencyProperty DependencyProperty No
binding BindingExpression No
Returns : boolean
Private subscribeToBindingPathChanges
subscribeToBindingPathChanges(context: any, binding: Binding, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
context any No
binding Binding No
dependencyProperty DependencyProperty No
bindingExpression BindingExpression No
Returns : void
Private subscribeToErrorsChangedInModel
subscribeToErrorsChangedInModel(errorCtxt: INotifyDataErrorInfo, propertyToSubscribe: string, bindingExpression: BindingExpression)
Inherited from DependencyObject
Parameters :
Name Type Optional
errorCtxt INotifyDataErrorInfo No
propertyToSubscribe string No
bindingExpression BindingExpression No
Returns : void
Private subscribeToPropertyChanges
subscribeToPropertyChanges(currentContext: any, outerContext: any, properties: string[], propertyIndex: number, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression, subscriptionsForCurrentBindingPath: Array<>)
Inherited from DependencyObject
Parameters :
Name Type Optional
currentContext any No
outerContext any No
properties string[] No
propertyIndex number No
dependencyProperty DependencyProperty No
bindingExpression BindingExpression No
subscriptionsForCurrentBindingPath Array<> No
Returns : void
Private updateSourceOfBinding
updateSourceOfBinding(binding: Binding, outerContext: any, dependencyProperty: DependencyProperty)
Inherited from DependencyObject

Updates the source of a binding

Parameters :
Name Type Optional
binding Binding No
outerContext any No
dependencyProperty DependencyProperty No
Returns : void

Accessors

RowsManager
getRowsManager()

returns the rowsManager instance, which is responsible for managing the rows of the grid this is a custom property created by Mobilize team to access the rowsManager

Returns : XamGridRowsManager
ActiveCell
getActiveCell()

Gets the ActiveCell

Returns : CellBase
setActiveCell(value: CellBase)

Sets the ActiveCell

Parameters :
Name Type Optional
value CellBase No
Returns : void
IsEditableOnAdd
getIsEditableOnAdd()

Flag to determine if the row should enter edit mode on add

Returns : boolean
setIsEditableOnAdd(value: boolean)

Sets the IsEditableOnAdd flag

Parameters :
Name Type Optional
value boolean No
Returns : void
ItemsSource
getItemsSource()

Gets or sets the items source

Returns : Iterable<any>
setItemsSource(value: Iterable<any>)
Parameters :
Name Type Optional
value Iterable<any> No
Returns : void
SelectionSettings
getSelectionSettings()

SelectionSettings

Returns : SelectionSettings
setSelectionSettings(value: SelectionSettings)
Parameters :
Name Type Optional
value SelectionSettings No
Returns : void
Columns
getColumns()

Columns

Rows
getRows()

Rows

Returns : RowCollection
import {
  DependencyObject,
  INotifyPropertyChanged,
  IValueConverter,
} from '../../basecomponentmodel';
import { Control } from '../../basecomponentmodel/Control';
import { Dependency } from '../../basecomponentmodel/Dependency';
import { DependencyProperty } from '../../basecomponentmodel/DependencyProperty';
import { DependencyPropertyChangedEventArgs } from '../../basecomponentmodel/DependencyPropertyChangedEventArgs';
import { RuntimeStyleInfo } from '../../basecomponentmodel/RuntimeStyleInfo';
import {
  IPagedCollectionView,
  iuAny,
  iuFirstOrDefault,
  ObservableCollection,
  SimpleList,
} from '../../baseframework/collections';
import { ReflectionHelper } from '../../baseframework/ReflectionSupport';
import { Debugger } from '../../diagnostics/Debugger';
import { AngularComponentId } from '../../helpers/AngularComponentId';
import { transformStyles } from '../../utils/StyleFunctions';
import { SubscriptionEvent } from '../../utils/SubscriptionEvent';
import { XamSelectionMode } from '../enums/SelectionMode';
import { SortDirection } from '../enums/SortDirection';
import { RoutedEventArgs } from '../events/RoutedEventArgs';
import { ActiveCellChangingEventArgs } from './ActiveCellChangingEventArgs';
import { CancellableEventArgs } from './CancellableEventArgs';
import { CellAlignment } from './CellAlignment';
import { CellBase } from './CellBase';
import { ChildBandCell } from './ChildBandCell';
import { ColumnLayout } from './ColumnLayout';
import { ContentControlModel } from './ContentControlModel';
import { ColumnWidth } from './DataGridLengthModel';
import { FilterRow } from './FilterRow';
import { InvokeAction } from './InvokeAction';
import { RowBase } from './RowBase';
import { RowCollection } from './RowCollection';
import { RowsManager } from './RowsManager';
import { ThicknessModel } from './ThicknessModel';
import {
  XamGridColumnModel,
  XamGridGroupColumnModel,
} from './XamGridColumnModel';
import { XamGridRow } from './XamGridRow';
import { XamGridRowsManager } from './XamGridRowsManager';

/**
 *  Enumeration for specifying the kinds of overs
 *
 * @export
 * @enum {number}
 * @wEnum Infragistics.Controls.Grids.RowHoverType
 */
export enum RowHoverType {
  Cell,
  Row,
  None,
}

/**
 * Valid column types for XamGrid.
 *
 * @export
 */
export type XamGridColumnType = 'int' | 'decimal' | 'int?' | 'Nullable<int>';
/**
 *  Class that represents the Model of the XamGrid
 *
 * @export
 * @class XamGridModel
 * @extends {Control}
 * @wType Infragistics.Controls.Grids.XamGrid
 */
export class XamGridModel extends Control {
  /**
   * Custom Mobilize property to access the XamGridComponent.
   *
   * @type {*}
   * @memberof XamGridModel
   */
  gridComponentInstance: any = null;

  /**
   * Flag to prevent clearing Active Cell when CollectionChnged is triggered.
   *
   * @memberof XamGridModel
   * @wIgnore
   */
  PreventClearActiveCell = false;

  /**
   * SelectedRowProperty dependency property.
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   * @wIgnore
   */
  static SelectedRowProperty = new DependencyProperty(
    'SelectedRow',
    null,
    null
  );

  /**
   *  ActiveItemProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static ActiveItemProperty: DependencyProperty = new DependencyProperty(
    'ActiveItem',
    null,
    null
  );

  /**
   *  AutoGenerateColumnsProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static AutoGenerateColumnsProperty: DependencyProperty =
    new DependencyProperty('AutoGenerateColumns', true, null);

  /**
   *  CellControlGenerationModeProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static CellControlGenerationModeProperty: DependencyProperty =
    new DependencyProperty('CellControlGenerationMode', null, null);

  /**
   *  CellStyleProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static CellStyleProperty: DependencyProperty = new DependencyProperty(
    'CellStyle',
    null,
    null
  );

  /**
   *  ChildBandHeaderHeightProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static ChildBandHeaderHeightProperty: DependencyProperty =
    new DependencyProperty('ChildBandHeaderHeight', null, null);

  /**
   *  ChildBandHeaderStyleProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static ChildBandHeaderStyleProperty: DependencyProperty =
    new DependencyProperty('ChildBandHeaderStyle', null, null);

  /**
   *  ColumnLayoutHeaderVisibilityProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static ColumnLayoutHeaderVisibilityProperty: DependencyProperty =
    new DependencyProperty('ColumnLayoutHeaderVisibility', null, null);

  /**
   *  ColumnsFooterTemplateProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static ColumnsFooterTemplateProperty: DependencyProperty =
    new DependencyProperty('ColumnsFooterTemplate', null, null);

  /**
   *  ColumnWidthProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static ColumnWidthProperty: DependencyProperty =
    new DependencyProperty('ColumnWidth', ColumnWidth.InitialAuto, null);

  /**
   *  DeleteKeyActionProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static DeleteKeyActionProperty: DependencyProperty =
    new DependencyProperty('DeleteKeyAction', null, null);

  /**
   *  FixedRowSeparatorStyleProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static FixedRowSeparatorStyleProperty: DependencyProperty =
    new DependencyProperty('FixedRowSeparatorStyle', null, null);

  /**
   *  FooterRowHeightProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static FooterRowHeightProperty: DependencyProperty =
    new DependencyProperty('FooterRowHeight', null, null);

  /**
   * FooterStyleProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static FooterStyleProperty: DependencyProperty =
    new DependencyProperty('FooterStyle', null, null);

  /**
   *  FooterVisibilityProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static FooterVisibilityProperty: DependencyProperty =
    new DependencyProperty('FooterVisibility', false, null);

  /**
   *  HeaderRowHeightProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static HeaderRowHeightProperty: DependencyProperty =
    new DependencyProperty('HeaderRowHeight', null, null);

  /**
   *  HeaderStyleProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static HeaderStyleProperty: DependencyProperty =
    new DependencyProperty(
      'HeaderStyle',
      null,
      XamGridModel.TransformStyleCallback
    );

  /**
   *  HeaderTemplateProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static HeaderTemplateProperty: DependencyProperty =
    new DependencyProperty('HeaderTemplate', null, null);

  /**
   *  HeaderTextHorizontalAlignmentProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static HeaderTextHorizontalAlignmentProperty: DependencyProperty =
    new DependencyProperty('HeaderTextHorizontalAlignment', null, null);

  /**
   *  HeaderTextVerticalAlignmentProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static HeaderTextVerticalAlignmentProperty: DependencyProperty =
    new DependencyProperty('HeaderTextVerticalAlignment', null, null);

  /**
   *  HeaderVisibilityProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static HeaderVisibilityProperty: DependencyProperty =
    new DependencyProperty('HeaderVisibility', null, null);

  /**
   *  IndentationProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static IndentationProperty: DependencyProperty =
    new DependencyProperty('Indentation', null, null);

  /**
   *  IsAlternateRowsEnabledProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static IsAlternateRowsEnabledProperty: DependencyProperty =
    new DependencyProperty('IsAlternateRowsEnabled', false, null);

  /**
   *  IsTouchSupportEnabledProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static IsTouchSupportEnabledProperty: DependencyProperty =
    new DependencyProperty('IsTouchSupportEnabled', null, null);

  /**
   *  ItemsSourceProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static ItemsSourceProperty: DependencyProperty =
    new DependencyProperty(
      'ItemsSource',
      null,
      XamGridModel.itemsSourceCallback
    );

  /**
   *  KeyboardNavigationProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static KeyboardNavigationProperty: DependencyProperty =
    new DependencyProperty('KeyboardNavigation', null, null);

  /**
   *  MaxDepthProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static MaxDepthProperty: DependencyProperty = new DependencyProperty(
    'MaxDepth',
    null,
    null
  );

  /**
   *  MinimumRowHeightProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static MinimumRowHeightProperty: DependencyProperty =
    new DependencyProperty('MinimumRowHeight', null, null);

  /**
   *  RowHeightProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static RowHeightProperty: DependencyProperty = new DependencyProperty(
    'RowHeight',
    null,
    null
  );

  /**
   *  RowHoverProperty dependency property
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamGridModel
   */
  public static RowHoverProperty: DependencyProperty = new DependencyProperty(
    'RowHover',
    RowHoverType.Cell,
    null
  );
  private readonly _rowsManager: XamGridRowsManager;

  /**
   * Keeps the current edit cell
   *
   * @type {XamGridCell}
   * @memberof XamGridModel
   */
  public CurrentEditCell: XamGridCell;

  /**
   * Keeps the current edit row
   *
   * @type {XamGridRow}
   * @memberof XamGridModel
   */
  public CurrentEditRow: XamGridRow;

  /**
   * Sets the grid height to limit how many rows are rendered
   * accepts null value, which will render all rows in the DOM with no scrollbar
   *
   * @type {string|null}
   * @memberof XamGridModel
   */
  virtualHeight: string | null = '100%';

  /**
   * Keeps the current active cell
   *
   * @private
   * @type {CellBase}
   * @memberof XamGridModel
   */
  private _activeCell: CellBase;

  /**
   * Mobilize callback to set the ActiveCell when the igx-grid is rendered
   *
   * @type {*}
   * @memberof XamGridModel
   */
  contextActiveCell: () => void;

  /**
   * Internal property to keep the current Selection setting for the xamGrid
   *
   * @private
   * @type {SelectionSettings}
   * @memberof XamGridModel
   */
  private _selectionSettings: SelectionSettings;

  /**
   * returns the rowsManager instance, which is responsible for managing the rows of the grid
   * this is a custom property created by Mobilize team to access the rowsManager
   * @readonly
   * @protected
   * @type {XamGridRowsManager}
   * @memberof XamGridModel
   */
  public get RowsManager(): XamGridRowsManager {
    return this._rowsManager;
  }

  /**
   * Triggers a special model change event when ItemsSource changes.
   *
   * @private
   * @static
   * @param {DependencyObject} sender
   * @param {DependencyPropertyChangedEventArgs} args
   * @memberof XamGridModel
   */
  private static itemsSourceCallback(
    sender: DependencyObject,
    args: DependencyPropertyChangedEventArgs
  ) {
    if (sender instanceof XamGridModel) {
      sender.ItemsSourceAsPagedCollection = null;
      if (
        args.NewValue &&
        ReflectionHelper.isInterfaceIsSupported(
          args.NewValue,
          'System.ComponentModel.IPagedCollectionView'
        )
      ) {
        sender.ItemsSourceAsPagedCollection = args.NewValue;
      }
      sender.ApplyItemSource(args.NewValue as Iterable<any>);
      sender.change.fire(['ItemsSourceChanged', args]);
    }
  }
  /**
   * Applies the Item source
   *
   * @param {Iterable<any>} itemSource
   * @memberof XamGridModel
   * @wIgnore
   */
  ApplyItemSource(itemSource: Iterable<any>) {
    if (this._rowsManager.ItemsSource !== itemSource) {
      this._rowsManager.ItemsSource = itemSource;
      this.SortingSettings.SortedColumns?.clear();
    }
  }

  /**
   * Creates an instance of XamGridModel.
   * @memberof XamGridModel
   */
  constructor() {
    super();
    this._rowsManager = new XamGridRowsManager(this);
  }

  /**
   * Notify this model of a data update.
   *
   * @memberof XamGridModel
   * @wIgnore
   */
  public NotifyDataUpdate(): void {
    this.adjustColumnTypesBasedOnNewData();
    this.change.fire(['DataUpdate']);
  }

  /**
   *  Adjust column DataType properties based on new data
   *
   * @private
   * @static
   * @param {DependencyPropertyChangedEventArgs} args
   * @param {XamGridModel} sender
   * @memberof XamGridModel
   */
  public adjustColumnTypesBasedOnNewData(): void {
    if (
      !this.dataColumnInfoAdjusted &&
      this.ItemsSource &&
      this.Columns.count > 0 &&
      this.ItemsSource[Symbol.iterator]
    ) {
      const firstRow = iuFirstOrDefault(this.ItemsSource);
      if (
        firstRow &&
        typeof firstRow === 'object' &&
        firstRow.constructor !== Object
      ) {
        const typeInfo = ReflectionHelper.getTypeInfo(firstRow);
        for (const textColumn of this.Columns) {
          if (textColumn.Key in firstRow) {
            const propInfo = typeInfo.getProperty(textColumn.Key);
            if (propInfo.propertyType?.JSType === Date) {
              textColumn.DataType = 'date';
            }
          }
        }
        this.dataColumnInfoAdjusted = true;
      }
    }
  }

  public AngularComponentId = AngularComponentId.xamGrid;

  /**
   * Rendered subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  Rendered = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  /**
   * Loaded subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  Loaded = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  /**
   * Unloaded subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  Unloaded = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  /**
   * CellSelectionChanged subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  CellSelectionChanged = new SubscriptionEvent<
    (s: XamGridModel, e: any) => void
  >();
  /**
   * RowSelectionChanged subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  RowSelectionChanged = new SubscriptionEvent<
    (s: XamGridModel, e: any) => void
  >();
  /**
   * RowsCollectionChanged subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  RowsCollectionChanged = new SubscriptionEvent<
    (s: XamGridModel, e: any) => void
  >();
  /**
   * ColumnSelectionChanged subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  ColumnSelectionChanged = new SubscriptionEvent<
    (s: XamGridModel, e: any) => void
  >();
  ColumnSorted = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  ColumnSorting = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  /**
   * ColumnFiltered subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  ColumnFiltered = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  ColumnResized = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  ColumnResizing = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  ColumnFixedStateChanged = new SubscriptionEvent<
    (s: XamGridModel, e: any) => void
  >();
  CellClicked = new SubscriptionEvent<
    (s: XamGridModel, e: CellClickedEventArgs) => void
  >();
  CellControlAttached = new SubscriptionEvent<
    (s: XamGridModel, e: CellControlAttachedEventArgs) => void
  >();
  /**
   * AfterCellControlAttached subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  AfterCellControlAttached = new SubscriptionEvent<
    (s: XamGridModel, e: CellControlAttachedEventArgs) => void
  >();
  CellDoubleClicked = new SubscriptionEvent<
    (s: XamGridModel, e: any) => void
  >();
  /**
   * KeyDown subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  KeyDown = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  ActiveCellChanged = new SubscriptionEvent<
    (s: XamGridModel, e: any) => void
  >();
  ActiveCellChanging = new SubscriptionEvent<
    (s: XamGridModel, e: any) => void
  >();
  CellEnteredEditMode = new SubscriptionEvent<
    (s: XamGridModel, e: EditingCellEventArgs) => void
  >();
  SelectedRowsCollectionChanged: SubscriptionEvent<any> =
    new SubscriptionEvent<any>();
  CellExitingEditMode = new SubscriptionEvent<
    (s: XamGridModel, e: ExitEditingCellEventArgs) => void
  >();
  CellExitedEditMode = new SubscriptionEvent<
    (s: XamGridModel, e: CellExitedEditingEventArgs) => void
  >();
  CellEnteringEditMode = new SubscriptionEvent<
    (s: XamGridModel, e: BeginEditingCellEventArgs) => void
  >();
  /**
   * CellEditing subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  CellEditing = new SubscriptionEvent<
    (s: XamGridModel, e: EditingCellEventArgs) => void
  >();
  /**
   * CellEdited subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  CellEdited = new SubscriptionEvent<
    (s: XamGridModel, e: ExitEditingCellEventArgs) => void
  >();
  InitializeRow = new SubscriptionEvent<
    (s: XamGridModel, e: InitializeRowEventArgs) => void
  >();
  PageIndexChanged = new SubscriptionEvent<
    (s: XamGridModel, e: PageChangedEventArgs) => void
  >();
  PageIndexChanging = new SubscriptionEvent<
    (s: XamGridModel, e: CancellablePageChangingEventArgs) => void
  >();
  RowAdded = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  RowDeleted = new SubscriptionEvent<(s: XamGridModel, e: any) => void>();
  RowExitedEditMode = new SubscriptionEvent<
    (s: XamGridModel, e: EditingRowEventArgs) => void
  >();
  RowEnteredEditMode = new SubscriptionEvent<
    (s: XamGridModel, e: EditingRowEventArgs) => void
  >();
  /**
   * ScrolledCellIntoView subscription event
   * @memberof XamGridModel
   * @wIgnore
   */
  ScrolledCellIntoView: SubscriptionEvent<(cell: XamGridCell) => void> =
    new SubscriptionEvent<(cell: XamGridCell) => void>();
  isEditableOnAdd: boolean;

  /**
   *  Flag to determine if the types of the column were adjusted based on new objects added to the items source
   *
   * @private
   * @memberof XamGridRow
   */
  private dataColumnInfoAdjusted = false;

  /**
   * Flag to manage when the editor template is loaded
   *
   * @type {boolean}
   * @memberof XamGridComponent
   */
  editorTemplateLoading = false;

  /**
   * Gets or sets the auto generate columns
   *
   * @memberof XamGridModel
   */
  @Dependency(XamGridModel.AutoGenerateColumnsProperty)
  AutoGenerateColumns: boolean;

  /**
   * Gets or sets the column width
   *
   * @memberof XamGridModel
   */
  @Dependency(XamGridModel.ColumnWidthProperty)
  ColumnWidth: ColumnWidth;

  /**
   * Gets or sets the IsAlternateRowsEnabled property
   *
   * @memberof XamGridModel
   */
  @Dependency(XamGridModel.IsAlternateRowsEnabledProperty)
  IsAlternateRowsEnabled: boolean;

  FilteringSettings = new FilteringSettings();

  /**
   * Gets or sets the footer visibility
   *
   * @memberof XamGridModel
   */
  @Dependency(XamGridModel.FooterVisibilityProperty)
  FooterVisibility: boolean;

  EditingSettings = new EditingSettings();

  /**
   * Gets or sets the header style
   *
   * @type {RuntimeStyleInfo}
   * @memberof XamGridModel
   */
  @Dependency(XamGridModel.HeaderStyleProperty)
  HeaderStyle: RuntimeStyleInfo;

  RowSelectorSettings = new RowSelectorSettings();
  /**
   * Gets or sets the row hover
   *
   * @memberof XamGridModel
   */
  @Dependency(XamGridModel.RowHoverProperty)
  RowHover: RowHoverType;

  PagerSettings = new PagerSettings();
  SortingSettings = new SortingSettings();
  FixedColumnSettings = new FixedColumnSettings();
  ColumnResizingSettings = new ColumnResizingSettings();
  ColumnMovingSettings = new ColumnMovingSettings();
  /**
   * Gets or sets the selected column index
   *
   * @memberof XamGridModel
   * @wIgnore
   */
  SelectedColumnIndex: any;
  BorderThickness: ThicknessModel = new ThicknessModel();
  BorderBrush: any;
  HeaderVisibility: any = 'visible';

  /**
   * headerStyleProperty css properties object used to apply
   *
   * @type {*}
   * @memberof XamGridModel
   * @wIgnore
   */
  HeaderStylePropertyToApply: any = {};

  /**
   * Callback function to transform style object.
   *
   * @static
   * @param {XamGridModel} sender
   * @param {DependencyPropertyChangedEventArgs} args
   * @memberof XamGridModel
   * @wIgnore
   */
  public static TransformStyleCallback(
    sender: XamGridModel,
    args: DependencyPropertyChangedEventArgs
  ) {
    const xamGridModel: any = sender;
    const newStyle = args.NewValue;
    /* istanbul ignore else */
    if (newStyle instanceof RuntimeStyleInfo) {
      transformStyles(
        xamGridModel.HeaderStylePropertyToApply,
        newStyle.Setters
      );
    }
  }

  /**
   * Gets the ActiveCell
   *
   * @type {CellBase}
   * @memberof XamGridModel
   */
  public get ActiveCell(): CellBase {
    return this._activeCell;
  }

  /**
   * Sets the ActiveCell
   *
   * @memberof XamGridModel
   */
  public set ActiveCell(value: CellBase) {
    this.SetActiveCell(
      value,
      CellAlignment.NotSet,
      InvokeAction.Code,
      true,
      true,
      true
    );
    /* istanbul ignore else */
    if (this._activeCell == null) {
      this.contextActiveCell = null;
      return;
    }
    const isOnCellActiveEditingEnabled =
      this.EditingSettings?.IsOnCellActiveEditingEnabled;
    const isReadOnly = this._activeCell.Column.IsReadOnly;
    this.contextActiveCell = () => {
      this.gridComponentInstance.processActiveCell(
        isOnCellActiveEditingEnabled,
        isReadOnly
      );
      this.contextActiveCell = null;
    };
    setTimeout(() => {
      /* istanbul ignore else */
      if (
        this.gridComponentInstance &&
        !this.gridComponentInstance.callProcessActiveCellFlag
      ) {
        this.gridComponentInstance.processActiveCell(
          isOnCellActiveEditingEnabled,
          isReadOnly
        );
      }
    }, 200);
  }

  /**
   * Set the active Cell for the xamGrid,
   * trigger events for OnActiveCellChanging and OnActiveCellChanged
   *
   * @param {CellBase} cell
   * @param {CellAlignment} alignment
   * @param {InvokeAction} action
   * @param {boolean} allowSelection
   * @param {boolean} setFocus
   * @param {boolean} scrollIntoView
   * @return {*}
   * @memberof XamGridModel
   */
  SetActiveCell(
    cell: CellBase,
    alignment: CellAlignment,
    action: InvokeAction,
    allowSelection: boolean,
    setFocus: boolean,
    scrollIntoView: boolean
  ) {
    if (cell != null) {
      if (!cell.Column.Visibility) {
        throw new Error('InvalidActiveCellException');
      }
    } else if (this.ActiveCell == null) {
      return;
    }
    if (cell != null && this.ActiveCell == cell) {
      if (cell.Control == null) {
        return;
      }
      if (cell.Control.Content instanceof Control) {
        cell.Control.Content.focus?.();
        return;
      }
    }
    if (scrollIntoView && cell != null && this.ActiveCell != cell && cell.Row) {
      this.ScrollCellIntoView(cell);
    }

    this.isInEditMode(cell);
    return this.ActiveLifeCycle(cell);
  }

  isInEditMode(cell: CellBase) {
    // the next to if statements are to prevent the active cell when the grid is in editmode!
    if (this.CurrentEditRow != null) {
      if (cell != null && cell.Row != this.CurrentEditRow) {
        this.ScrollCellIntoView(this.CurrentEditCell);
        return;
      }
    } else if (this.CurrentEditCell != null) {
      const currentEditCell = this.CurrentEditCell;
      // if true, we need to scroll the cell into view
      if (
        currentEditCell.Row instanceof FilterRow &&
        cell != null &&
        !(cell.Row instanceof FilterRow) &&
        currentEditCell.Row.RowsManager instanceof RowsManager
      ) {
        const dataManager = currentEditCell.Row.RowsManager.DataManager;
        if (dataManager != null) {
          if (dataManager.FilterItems.Count == 0) {
            return;
          }
        }
      }
    }
  }

  /**
   * Run the active life cycle of the activeNode process
   *
   * @private
   * @param {CellBase} cell
   * @return {*}
   * @memberof XamGridModel
   */
  private ActiveLifeCycle(cell: CellBase) {
    const cell2 = cell;
    if (cell2 == null && !(cell instanceof ChildBandCell)) {
      cell = null;
    }
    const activeCellChangingEventArgs = new ActiveCellChangingEventArgs();
    activeCellChangingEventArgs.NewActiveCell = cell;
    activeCellChangingEventArgs.PreviousActiveCell = this.ActiveCell;
    const activeCellChangingEventArgs2 = activeCellChangingEventArgs;
    this.OnActiveCellChanging(activeCellChangingEventArgs);
    if (!activeCellChangingEventArgs2.Cancel) {
      this._activeCell = cell;
      this.OnActiveCellChanged();
    }
    return cell;
  }

  OnActiveCellChanged() {
    this.ActiveCellChanged?.fire([this, {}]);
  }

  OnActiveCellChanging(e: ActiveCellChangingEventArgs) {
    this.ActiveCellChanging?.fire([this, e]);
  }

  /**
   * Flag to determine if the row should enter edit mode on add
   *
   * @memberof XamGridModel
   * @wIgnore
   */
  get IsEditableOnAdd(): boolean {
    return this.isEditableOnAdd;
  }

  /**
   * Sets the IsEditableOnAdd flag
   * @memberof XamGridModel
   * @wIgnore
   */
  set IsEditableOnAdd(value: boolean) {
    this.isEditableOnAdd = value;
  }

  /**
   * Selected row property
   * @memberof XamGridModel
   * @wIgnore
   */
  @Dependency(XamGridModel.SelectedRowProperty)
  public SelectedRow: any;

  /**
   * Gets or sets the items source
   *
   * @type {*}
   * @memberof XamGridModel
   */
  public get ItemsSource(): Iterable<any> {
    return this._rowsManager.ItemsSource;
  }

  public set ItemsSource(value: Iterable<any>) {
    this.setValue(XamGridModel.ItemsSourceProperty, value);
  }

  /**
   * SelectedIndex
   *
   * @type {*}
   * @memberof XamGridModel
   * @wIgnore
   */
  SelectedIndex: any;

  /**
   * SelectedItems
   *
   * @type {ObservableCollection<any>}
   * @memberof XamGridModel
   * @wIgnore
   */
  SelectedItems: ObservableCollection<any> = new ObservableCollection<any>();

  /**
   * SelectionSettings
   *
   * @memberof XamGridModel
   */
  get SelectionSettings(): SelectionSettings {
    if (this._selectionSettings == null) {
      this._selectionSettings = new SelectionSettings(
        this._rowsManager.ColumnLayout
      );
    }
    this._selectionSettings.Grid = this;
    return this._selectionSettings;
  }

  set SelectionSettings(value: SelectionSettings) {
    if (value !== this._selectionSettings) {
      this._selectionSettings = value;
    }
  }

  /**
   * Columns
   *
   * @memberof XamGridModel
   */
  get Columns(): ColumnBaseCollection {
    return this._rowsManager.ColumnLayout.Columns;
  }

  /**
   * Rows
   *
   * @memberof XamGridModel
   */
  get Rows(): RowCollection {
    return this._rowsManager.Rows.ActualCollection as any;
  }

  /**
   * addColumn
   *
   * @param {XamGridColumnModel} column
   * @memberof XamGridModel
   */
  public addColumn(column: XamGridColumnModel): void {
    this.setColumnInfo(column);
    this.Columns.add(column);
  }

  addVisualColumn(column: XamGridColumnModel): void {
    this.setColumnInfo(column);
    this.Columns.add(column);
  }

  /**
   * Sets the ColumnLayout for the row
   *
   * @private
   * @param {XamGridColumnModel} column
   * @memberof XamGridModel
   */
  private setColumnInfo(column: XamGridColumnModel) {
    column.ColumnLayout = this._rowsManager.ColumnLayout;
    column.Parent = this;
  }

  /**
   * getColumns
   *
   * @return {*}  {ColumnBaseCollection}
   * @memberof XamGridModel
   */
  public getColumns(): ColumnBaseCollection {
    return this.Columns;
  }

  /**
   * ScrollCellIntoView
   *
   * @param {*} cell
   * @memberof XamGridModel
   */
  public ScrollCellIntoView(cell: CellBase): void {
    if (cell instanceof XamGridCell && cell.Row.Index !== -1) {
      this.ScrolledCellIntoView.fire([cell]);
    }
  }

  /**
   * fire CellSelectionChangeHandler
   *
   * @param {*} event
   * @memberof XamGridModel
   * @wIgnore
   */
  public CellSelectionChangeHandler(event: any): void {
    this.CellSelectionChanged.fire([this, event]);
  }

  /**
   * ScrollIntoView
   *
   * @param {...any[]} args
   * @memberof XamGridModel
   * @wIgnore
   */
  public ScrollIntoView(...args: any[]): void {
    Debugger.Throw('Not implemented');
  }

  /**
   * Fire RowSelectionChangeHandler
   *
   * @param {*} event
   * @memberof XamGridModel
   * @wIgnore
   */
  public RowSelectionChangeHandler(event: any): void {
    this.RowSelectionChanged.fire([this, event]);
  }

  /**
   * Fire ColumnSelectionChangeHandler
   *
   * @param {*} event
   * @memberof XamGridModel
   * @wIgnore
   */
  public ColumnSelectionChangeHandler(event: any): void {
    this.ColumnSelectionChanged.fire([this, event]);
  }

  /**
   * KeyDownHandler
   *
   * @param {*} event
   * @memberof XamGridModel
   * @wIgnore
   */
  public KeyDownHandler(event: any): void {
    this.KeyDown.fire([this, event]);
  }

  /**
   * Fire CellDoubleClickHandler
   *
   * @param {*} event
   * @memberof XamGridModel
   * @wIgnore
   */
  public CellDoubleClickHandler(event: any): void {
    this.CellDoubleClicked.fire([this, event]);
  }

  /**
   *  Property containing a reference as a IPagedCollection or null
   *
   * @return {*}  {IPagedCollectionView}
   * @memberof XamGridModel
   * @wIgnore
   */
  public ItemsSourceAsPagedCollection: IPagedCollectionView = null;

  /**
   * Dispose
   *
   * @param {boolean} [disposing]
   * @memberof XamGridModel
   */
  public Dispose(disposing?: boolean) {
    Debugger.Throw('Not implemented');
  }

  /**
   * ExitEditMode
   *
   * @param {boolean} cancel
   * @memberof XamGridModel
   */
  public ExitEditMode(cancel: boolean) {
    this.change.fire(['triggerExitEditMode', !cancel]);
  }

  /**
   * ExitEditModeInternal
   *
   * @param {boolean} cancel
   * @memberof XamGridModel
   * @wNoMap
   */
  public ExitEditModeInternal(cancel: boolean) {
    Debugger.Throw('Not implemented');
  }

  /**
   * OnPropertyChanged
   *
   * @param {string} name
   * @memberof XamGridModel
   * @wNoMap
   */
  public OnPropertyChanged(name: string) {
    Debugger.Throw('Not implemented');
  }

  /**
   * On Got Focus handler for XamGrid
   *
   * @param {*} sender
   * @param {*} [args]
   * @memberof XamGridModel
   */
  public OnGotFocus(args: RoutedEventArgs): void {
    super.OnGotFocus(args);
    if (this.CurrentEditCell == null && this.ActiveCell == null) {
      if (this.Rows.count > 0 && this.Rows.getItem(0).Cells.count > 0) {
        const setFocus = true;
        for (let cell of this.Rows.getItem(0).Cells) {
          if (cell instanceof CellBase && cell.Column.Visibility) {
            this.SetActiveCell(
              cell,
              CellAlignment.NotSet,
              InvokeAction.Code,
              true,
              setFocus,
              false
            );
            break;
          }
        }
      }
    }
  }

  /**
   * Sets the data type associated with a column name. Valid examples
   * of column types are:
   * - 'int'
   * - 'decimal'
   * - 'int?'
   * - 'Nullable\<int\>'
   * - etc.
   *
   * @param {string} columnName
   * @param {XamGridColumnType} type
   * @memberof XamGridModel
   * @wIgnore
   */
  public SetColumnType(columnName: string, type: XamGridColumnType): void {
    this.columnTypes.set(columnName, type);
  }

  /**
   * Returns `true` if the given column name has an associated data type,
   * `false` otherwise.
   *
   * @param {string} columnName
   * @return {*}  {boolean}
   * @memberof XamGridModel
   * @wIgnore
   */
  public HasColumnType(columnName: string): boolean {
    return this.columnTypes.has(columnName);
  }

  /**
   * Returns the column data type associated with the given column name.
   *
   * @param {string} columnName
   * @return {*}  {string}
   * @memberof XamGridModel
   * @wIgnore
   */
  public GetColumnType(columnName: string): XamGridColumnType {
    return this.columnTypes.get(columnName);
  }

  /**
   * Clears selected rows.
   *
   * @memberof XamGridModel
   * @wIgnore
   */
  public ClearSelectedRows(): void {
    this.SelectionSettings.SelectedRows.clear();
    for (const row of this.Rows) {
      row.IsSelected = false;
    }
  }

  /**
   * A callback function to handle row selection
   *
   * @param {XamGridRow} row
   * @memberof XamGridModel
   */
  public SelectRow(row: XamGridRow): void {
    const selectedRows = this.SelectionSettings?.SelectedRows;
    let oldRows = selectedRows
      ? new SelectedRowsCollection(selectedRows.toArray())
      : new SelectedRowsCollection();
    let isChanged = false;

    if (
      selectedRows &&
      this.SelectionSettings?.RowSelection === XamSelectionMode.Single
    ) {
      if (
        selectedRows.count > 1 ||
        !iuAny(
          selectedRows,
          (anotherRow) => anotherRow == row || anotherRow.Data === row.Data
        )
      ) {
        selectedRows.clear();
        selectedRows.add(row);
        isChanged = true;
      }
    } else if (
      selectedRows &&
      !iuAny(
        selectedRows,
        (anotherRow) => anotherRow == row || anotherRow.Data === row.Data
      )
    ) {
      selectedRows.add(row);
      isChanged = true;
    }

    if (isChanged && this.SelectedRow != row) {
      // Fire SelectedRowsCollectionChanged event
      let newRows = new SelectedRowsCollection(selectedRows.toArray());
      const params = new SelectionCollectionChangedEventArgs();
      params.NewSelectedItems = new SelectedRowsCollection(newRows);
      params.PreviouslySelectedItems = new SelectedRowsCollection(oldRows);
      this.SelectedRowsCollectionChanged.fire([this, params]);
      this.RowSelectionChangeHandler(params);
    }
  }

  /**
   * A callback function to handle the unselection of rows
   *
   * @param {XamGridRow} row
   * @memberof XamGridModel
   */
  public UnselectRow(row: XamGridRow): void {
    const selectedRows = this.SelectionSettings?.SelectedRows;
    if (selectedRows == null) {
      return;
    }

    const unSelectedRow = iuFirstOrDefault(
      selectedRows,
      (each: XamGridRow) => each.Data === row.Data
    );
    let oldRows = new SelectedRowsCollection(selectedRows.toArray());
    if (unSelectedRow != null) {
      selectedRows.remove(unSelectedRow);
      let newRows = new SelectedRowsCollection(selectedRows.toArray());
      // Fire SelectedRowsCollectionChanged event
      const params = new SelectionCollectionChangedEventArgs();
      params.NewSelectedItems = new SelectedRowsCollection(newRows);
      params.PreviouslySelectedItems = new SelectedRowsCollection(oldRows);
      this.SelectedRowsCollectionChanged.fire([this, params]);
    }
  }

  /**
   * Stores information about column types.
   *
   * @private
   * @type {Map<string, XamGridColumnType>}
   * @memberof XamGridModel
   */
  private readonly columnTypes: Map<string, XamGridColumnType> = new Map<
    string,
    XamGridColumnType
  >();
}

// Replaced with class RowCollection
export class XamGridRowCollection<T> extends ObservableCollection<any> {
  private xamGrid: XamGridModel;

  constructor(parentGrid: XamGridModel) {
    super();
    this.xamGrid = parentGrid;
  }

  getItem(index: number): any {
    const row = super.getItem(index);
    return row;
  }

  /**
   * Inserts a new element at the specified position.
   *
   * @param {number} index
   * @param {XamGridRow} value
   * @memberof XamGridRowCollection
   */
  insert(index: number, value: XamGridRow): void {
    super.insert(index, value);
    if (index < 0 || value == null) {
      return;
    }

    const source = this.xamGrid.ItemsSource;
    if (source) {
      this.xamGrid.change.fire(['ItemsSource']);
    }
  }

  /**
   * Removes the first element from the collection which matches the given value.
   *
   * @param {XamGridRow} value
   * @return {boolean}
   * @memberof ObservableCollection
   */
  remove(value: XamGridRow): boolean {
    const result = super.remove(value);
    const source = this.xamGrid.ItemsSource;
    if (value != null && source) {
      const index = -1;
      if (index >= 0) {
        this.xamGrid.change.fire(['ItemsSource']);
      }
    }

    return result;
  }
}

/**
 *  Readonly collection of columns
 *
 * @export
 * @class ReadOnlyKeyedColumnBaseCollection
 * @extends {ObservableCollection<T>}
 * @template T
 * @wType Infragistics.Controls.Grids.ReadOnlyKeyedColumnBaseCollection`1
 */
export class ReadOnlyKeyedColumnBaseCollection<
  T extends XamGridColumnModel
> extends ObservableCollection<T> {
  getColumnByKey(key: string) {
    return findColumn(key, this);
  }
}

/**
 *  Base class for column collections
 *
 * @export
 * @class ColumnBaseCollection
 * @extends {ObservableCollection<XamGridColumnModel>}
 * @wType Infragistics.Controls.Grids.ColumnBaseCollection
 */
export class ColumnBaseCollection extends ObservableCollection<XamGridColumnModel> {
  /**
   * XamGrid ColumnLayout internal reference.
   *
   * @type {ColumnLayout}
   * @memberof ColumnBaseCollection
   */
  private _columnLayout: ColumnLayout;

  /**
   * List of non layout columns.
   *
   * @type {SimpleList<XamGridColumnModel>}
   * @memberof ColumnBaseCollection
   */
  private _nonLayoutColumns: SimpleList<XamGridColumnModel>;

  /**
   * XamGrid DataColumns internal reference.
   *
   * @type {ReadOnlyKeyedColumnBaseCollection<XamGridColumnModel>}
   * @memberof ColumnBaseCollection
   */
  private _dataColumns: ReadOnlyKeyedColumnBaseCollection<XamGridColumnModel>;

  /**
   * XamGrid cached data columns.
   *
   * @type {ColumnLayout}
   * @memberof ColumnBaseCollection
   */
  private _rebuildAllDataColumnsCache: boolean;

  /**
   * Gets XamGrid ColumnLayout reference.
   *
   * @readonly
   * @type {ColumnLayout}
   * @memberof ColumnBaseCollection
   */
  get ColumnLayout(): ColumnLayout {
    return this._columnLayout;
  }

  /**
   * Gets list of non layout columns.
   *
   * @readonly
   * @type {ColumnLayout}
   * @memberof ColumnBaseCollection
   * @wIgnore
   */
  get NonLayoutColumns(): SimpleList<XamGridColumnModel> {
    return this._nonLayoutColumns;
  }

  /**
   * Gets an array of data columns.
   *
   * @readonly
   * @type {ReadOnlyKeyedColumnBaseCollection<XamGridColumnModel>}
   * @memberof ColumnBaseCollection
   */
  get DataColumns(): ReadOnlyKeyedColumnBaseCollection<XamGridColumnModel> {
    return new ReadOnlyKeyedColumnBaseCollection(this.toArray());
  }

  /**
   * Creates an instance of ColumnBaseCollection class
   *
   * @param {ColumnLayout} ColumnLayout
   * @memberof ColumnBaseCollection
   */
  constructor(columnLayout: ColumnLayout) {
    super();
    this._columnLayout = columnLayout;
    this._nonLayoutColumns = new SimpleList<XamGridColumnModel>();
    this._dataColumns = new ReadOnlyKeyedColumnBaseCollection(
      this._nonLayoutColumns
    );
  }

  /**
   * Get a columns by its key.
   *
   * @param {string} key
   * @returns {XamGridColumnModel}
   * @memberof ColumnBaseCollection
   */
  getColumnByKey(key: string): XamGridColumnModel {
    return findColumn(key, this);
  }

  /**
   * Get a columns by its key recursively.
   *
   * @param {string} key
   * @memberof ColumnBaseCollection
   */
  getColumnByKeyDeep(key: string): {
    column: XamGridColumnModel;
    isRoot: boolean;
  } {
    const groupColumns = [];
    for (const column of this) {
      if (column.Key === key) {
        return { column, isRoot: true };
      }
      if (column instanceof XamGridGroupColumnModel) {
        groupColumns.push(column);
      }
    }

    for (const columnGroup of groupColumns) {
      let { column } = columnGroup.Columns.getColumnByKeyDeep(key);
      if (column) {
        return { column, isRoot: false };
      }
    }
    return { column: null, isRoot: false };
  }

  /**
   * Add a new item to the collection.
   *
   * @param {XamGridColumnModel} item
   * @type {void}
   * @memberof ColumnBaseCollection
   */
  AddItem(item: XamGridColumnModel): void {
    this.add(item);
    this.ColumnLayout.OnColumnAdded(item);
  }

  /**
   * Gets an item from the collection.
   *
   * @param {number} index
   * @type {XamGridColumnModel}
   * @memberof ColumnBaseCollection
   */
  getItem(index: number): XamGridColumnModel {
    if (index >= 0 || index < this.count) {
      return super.getItem(index);
    }
  }

  /**
   * Adds columns to the NonLayoutColumns collection.
   *
   * @param {boolean} fullInvalidate
   * @type {XamGridColumnModel}
   * @memberof ColumnBaseCollection
   */
  InvalidateColumnsCollections(fullInvalidate: boolean) {
    this._nonLayoutColumns.clear();
    if (this.ColumnLayout?.Grid) {
      this.internalArray.forEach((ColumnBase) => {
        if (ColumnBase instanceof XamGridColumnModel) {
          this._nonLayoutColumns.add(ColumnBase);
        }
      });
      this._rebuildAllDataColumnsCache = true;
    }
  }

  /**
   * add a new column to the collection.
   *
   * @param {XamGridColumnModel} value
   * @memberof ColumnBaseCollection
   */
  add(value: XamGridColumnModel): void {
    value.ColumnLayout = this.ColumnLayout;
    if (this.ColumnLayout?.Grid?.gridComponentInstance) {
      this.ColumnLayout.Grid.gridComponentInstance.forcedColumnsWidthCalc =
        true;
      this.ColumnLayout.Grid.gridComponentInstance.detectChangesAction?.();
    }
    super.add(value);
  }
}

/**
 *  Event arguments for the `page changed` event
 *
 * @export
 * @class PageChangedEventArgs
 * @wType Infragistics.Controls.Grids.PageChangedEventArgs
 */
export class PageChangedEventArgs {
  /**
   *  The index of the previous page
   *
   * @memberof PageChangedEventArgs
   */
  OldPageIndex = -1;
}

/**
 * Event argument for the "cancellable pagin changing" event
 *
 * @export
 * @class CancellablePageChangingEventArgs
 * @wType Infragistics.Controls.Grids.CancellablePageChangingEventArgs
 */
export class CancellablePageChangingEventArgs extends CancellableEventArgs {
  NextPageIndex = 0;
}

/**
 * Event argument for the "cell clicked" event
 *
 * @export
 * @class CellClickedEventArgs
 * @wType Infragistics.Controls.Grids.CellClickedEventArgs
 */
export class CellClickedEventArgs {
  constructor(protected model: XamGridCell) {}

  /**
   *  Cell being clicked
   *
   * @readonly
   * @type {*}
   * @memberof CellClickedEventArgs
   */
  get Cell(): any {
    return this.model;
  }
}

/**
 * Event arguments for the "Begin Editing Cell" event
 *
 * @export
 * @class BeginEditingCellEventArgs
 * @extends {CancellableEventArgs}
 * @wType Infragistics.Controls.Grids.BeginEditingCellEventArgs
 */
export class BeginEditingCellEventArgs extends CancellableEventArgs {
  constructor(protected model: XamGridCell) {
    super();
  }

  /**
   * Cell being edited
   *
   * @readonly
   * @type {*}
   * @memberof BeginEditingCellEventArgs
   */
  get Cell(): any {
    return this.model;
  }
}

/**
 *  Events object for the "Editing Cell" event arguments
 *
 * @export
 * @class EditingCellEventArgs
 * @wType Infragistics.Controls.Grids.EditingCellEventArgs
 */
export class EditingCellEventArgs extends CancellableEventArgs {
  constructor(protected model: XamGridCell) {
    super();
  }

  // Editor event args.
  #editor: any = null;
  /**
   *  Cell being edited
   *
   * @readonly
   * @type {*}
   * @memberof EditingCellEventArgs
   */
  get Cell(): XamGridCell {
    return this.model;
  }

  /**
   * Editor object
   *
   * @readonly
   * @type {*}
   * @memberof EditingCellEventArgs
   */
  get Editor(): any {
    return this.#editor;
  }

  /**
   * Set Editor property.
   *
   * @memberof EditingCellEventArgs
   */
  set Editor(value: any) {
    this.#editor = value;
  }
}

/**
 *  Base class for event arguments related to row events
 *
 * @export
 * @class RowEventArgs
 * @wType Infragistics.Controls.Grids.RowEventArgs
 */
export class RowEventArgs {
  /**
   * Gets the row property value
   * @wNoMap
   */
  get Row(): any {
    Debugger.Throw('Not implemented');
    return undefined;
  }
}

/**
 * Class used for EditRow Events
 *
 * @export
 * @class EditingRowEventArgs
 * @extends {RowEventArgs}
 * @wType Infragistics.Controls.Grids.EditingRowEventArgs
 */
export class EditingRowEventArgs extends RowEventArgs {
  constructor(row: any) {
    super();
    this.#row = row;
  }
  #row: XamGridRow;
  /**
   * Gets the Row affected by the event
   *
   * @type {*}
   * @memberof EditingRowEventArgs
   */
  get Row(): any {
    return this.#row;
  }
  set Row(value: any) {
    this.#row = value;
  }
}

/**
 *  Event arguments for row initialization
 *
 * @export
 * @class InitializeRowEventArgs
 * @extends {RowEventArgs}
 * @wType Infragistics.Controls.Grids.InitializeRowEventArgs
 */
export class InitializeRowEventArgs extends RowEventArgs {
  constructor(row: any) {
    super();
    this.#row = row;
  }
  #row: XamGridRow;
  /**
   * Gets the Row affected by the event
   *
   * @type {*}
   * @memberof InitializeRowEventArgs
   */
  get Row(): any {
    return this.#row;
  }
  /**
   * Sets the Row affected by the event
   *
   * @type {*}
   * @memberof InitializeRowEventArgs
   */
  set Row(value: any) {
    this.#row = value;
  }
}

/**
 *  Event argument for the "Cell Exited Editing" event
 *
 * @export
 * @class CellExitedEditingEventArgs
 * @wType Infragistics.Controls.Grids.CellExitedEditingEventArgs
 */
export class CellExitedEditingEventArgs {
  constructor(protected model: XamGridCell) {}

  /**
   *  Cell being edited
   *
   * @readonly
   * @type {*}
   * @memberof CellExitedEditingEventArgs
   */
  get Cell(): XamGridCell {
    return this.model;
  }
}

/**
 *  Event arguments for the "Cell Control Attached" event
 *
 * @export
 * @class CellControlAttachedEventArgs
 * @wType Infragistics.Controls.Grids.CellControlAttachedEventArgs
 */
export class CellControlAttachedEventArgs {
  constructor() {}

  /**
   * The cell being added to the grid view
   *
   * @readonly
   * @memberof CellControlAttachedEventArgs
   */
  Cell: XamGridCell;
}

/**
 *  Enumeration for cell selection arguments
 *
 * @export
 * @enum {number}
 * @wEnum Infragistics.Controls.Grids.CellSelectionAction
 */
export enum CellSelectionAction {
  /**
   * Row being selected
   */
  SelectRow,

  /**
   * Cell being selected
   */
  SelectCell,
}

/**
 * An object that contains settings for selection on the XamGrid
 *
 * @export
 * @class SelectionSettings
 * @wType Infragistics.Controls.Grids.SelectionSettings
 */
export class SelectionSettings {
  /**
   * Grid property
   * @wIgnore
   */
  Grid: XamGridModel;

  RowSelection = XamSelectionMode.Single;
  CellSelection = XamSelectionMode.Multiple;
  ColumnSelection = XamSelectionMode.None;
  /**
   * Custom property to handle internal checkbox selection , should be hide as default
   * @wIgnore
   */
  HideRowCheckboxes = true;
  CellClickAction = CellSelectionAction.SelectCell;

  SelectedCells = new ObservableCollection();
  SelectedColumns: ColumnBaseCollection;
  private _selectedRows: SelectedRowsCollection;

  /**
   * Gets or sets the selected rows collection
   *
   * @type {SelectedRowsCollection}
   * @memberof SelectionSettings
   */
  get SelectedRows(): SelectedRowsCollection {
    if (this._selectedRows == null) {
      this._selectedRows = new SelectedRowsCollection();
      this._selectedRows.Grid = this.Grid;
    }
    return this._selectedRows;
  }

  set SelectedRows(value) {
    this._selectedRows = value;
  }

  constructor(columnLayout: ColumnLayout) {
    this.SelectedColumns = new ColumnBaseCollection(columnLayout);
  }
}

/**
 * Enumeration for specifying the paging location
 *
 * @export
 * @enum {number}
 * @wEnum Infragistics.Controls.Grids.PagingLocation
 */
export enum PagingLocation {
  Both,
  Bottom,
  Hidden,
  None,
  Top,
}

/**
 * An object that contains settings for using PagerSettings on the XamGrid
 *
 * @export
 * @class PagerSettings
 * @wType Infragistics.Controls.Grids.PagerSettings
 */
export class PagerSettings extends Control {
  /**
   * AllowPagingProperty dependency property
   *
   * @static
   * @memberof PagerSettings
   */
  static AllowPagingProperty = new DependencyProperty(
    'AllowPaging',
    PagingLocation.None,
    null
  );

  /**
   * CurrentPageIndexProperty dependency property
   *
   * @static
   * @memberof PagerSettings
   * @wIgnore
   */
  static CurrentPageIndexProperty = new DependencyProperty(
    'CurrentPageIndex',
    0,
    null
  );

  /**
   * PageSizeProperty dependency property
   *
   * @static
   * @memberof PagerSettings
   */
  static PageSizeProperty = new DependencyProperty('PageSize', 10, null);
  protected _currentPageIndex = 0;
  protected _pageSize = 10;

  /**
   * Gets/sets if paging will be allowed by default.
   *
   * @type {PagingLocation}
   * @memberof PagerSettings
   */
  @Dependency(PagerSettings.AllowPagingProperty)
  public AllowPaging: PagingLocation;

  /**
   * Gets/sets what page of data will be displayed.
   *
   * @type {number}
   * @memberof PagerSettings
   */
  @Dependency(PagerSettings.CurrentPageIndexProperty)
  public CurrentPageIndex: number;

  /**
   * Gets/sets the maximum number of rows that will be available per page.
   *
   * @type {number}
   * @memberof PagerSettings
   */
  @Dependency(PagerSettings.PageSizeProperty)
  public PageSize: number;
}

/**
 * An object that contains settings for using ColumnResizingSettings on the XamGrid
 *
 * @export
 * @class ColumnResizingSettings
 * @wType Infragistics.Controls.Grids.ColumnResizingSettings
 */
export class ColumnResizingSettings {
  AllowColumnResizing = true;
}

/**
 * An object that contains settings for using ColumnMovingSettings on the XamGrid
 *
 * @export
 * @class ColumnMovingSettings
 * @wType Infragistics.Controls.Grids.ColumnMovingSettings
 */
export class ColumnMovingSettings {
  AllowColumnMoving = false;
}

/**
 * An object that contains settings for using RowSelectorSettings on the XamGrid
 *
 * @export
 * @class RowSelectorSettings
 * @wType Infragistics.Controls.Grids.RowSelectorSettings
 */
export class RowSelectorSettings {
  EnableRowNumbering = true;
}

/**
 * Enumeration for specifying the kind of filtering being used in the grid
 *
 * @export
 * @enum {number}
 * @wEnum Infragistics.Controls.Grids.FilteringScope
 */
export enum FilteringScope {
  ChildBand,
  ColumnLayout,
}

/**
 *  Class to represent the Sorting Settings
 *
 * @export
 * @class SortingSettings
 * @wType Infragistics.Controls.Grids.SortingSettings
 */
export class SortingSettings {
  AllowSorting = true;
  AllowMultipleColumnSorting = true;
  FirstSortDirection = SortDirection.Ascending;
  SortedColumns = new ObservableCollection<XamGridColumnModel>();
}

/**
 *  Interface for record filters
 *
 * @export
 * @interface IRecordFilter
 * @wInterface Infragistics.IRecordFilter
 */
export interface IRecordFilter {
  Conditions: any; // ConditionCollection;
  FieldName: string;
}

/**
 *  Enumeration for editing type
 *
 * @export
 * @enum {number}
 * @wEnum Infragistics.Controls.Grids.EditingType
 */
export enum XamGridEditingType {
  None,
  Cell,
  Row,
  Hover,
}

/**
 *  Enumeration for mouse editing action
 *
 * @export
 * @enum {number}
 * @wEnum Infragistics.Controls.Grids.MouseEditingAction
 */
export enum MouseEditingAction {
  DoubleClick,
  None,
  SingleClick,
}

/**
 * A class to represent the FilteringSettings
 * @export
 * @class RowFiltersCollection
 * @wType Infragistics.Controls.Grids.FilteringSettings
 */
export class FilteringSettings extends Control {
  /**
   * AllowFilteringProperty dependency property
   *
   * @static
   * @memberof FilteringSettings
   */
  static AllowFilteringProperty = new DependencyProperty(
    'AllowFiltering',
    0,
    null
  );

  protected _allowFiltering = FilterUIType.None;

  @Dependency(FilteringSettings.AllowFilteringProperty)
  public AllowFiltering: FilterUIType;

  FilteringScope = FilteringScope.ChildBand;

  RowFiltersCollection = new RowFiltersCollection();

  internalXamGrid: XamGridModel;
}

/**
 * A class to represent the RowFiltersCollection
 * @export
 * @class RowFiltersCollection
 * @wType Infragistics.Controls.Grids.RowFiltersCollection
 */
export class RowFiltersCollection extends ObservableCollection<IRecordFilter> {
  /**
   * Gets rows filter item by key
   *
   * @param {string} key
   * @returns
   * @memberof FilteringSettings
   */
  getItemByKey(key: string): IRecordFilter {
    return this.GetRowFilterByColumnKey(key);
  }

  /**
   * Gets row filter by column key
   *
   * @param {string} columnKey
   * @returns {IRecordFilter}
   * @memberof FilteringSettings
   */
  GetRowFilterByColumnKey(columnKey: string): IRecordFilter {
    for (const recordFilter of this.internalArray) {
      if (recordFilter.FieldName === columnKey) {
        return recordFilter;
      }
    }
    return null;
  }
}

/**
 * A class to represent the grid FixedColumnSettings
 * @export
 * @class EditingSettings
 * @wType Infragistics.Controls.Grids.FixedColumnSettings
 */
export class FixedColumnSettings {
  AllowFixedColumns = false;
  FixedColumnsLeft = new ObservableCollection<XamGridColumnModel>();
  FixedColumnsRight = new ObservableCollection<XamGridColumnModel>();
}

/**
 * A class to represent the grid Editing Settings
 * @export
 * @class EditingSettings
 * @wType Infragistics.Controls.Grids.EditingSettings
 */
export class EditingSettings {
  AllowEditing: XamGridEditingType;
  IsOnCellActiveEditingEnabled = false;
  IsMouseActionEditingEnabled = MouseEditingAction.DoubleClick;
  IsEnterKeyEditingEnabled = false;
  IsF2EditingEnabled = false;
}

/**
 *  Event arguments for the "Editing Cell" event
 *
 * @export
 * @class ExitEditingCellEventArgs
 * @extends {CancellableEventArgs}
 * @wType Infragistics.Controls.Grids.ExitEditingCellEventArgs
 */
export class ExitEditingCellEventArgs extends CancellableEventArgs {
  /**
   * Creates an instance of ExitEditingCellEventArgs.
   * @param {XamGridCell} model
   * @memberof ExitEditingCellEventArgs
   */
  constructor(protected model: XamGridCell) {
    super();
  }

  /**
   * Private reference to the editor instance
   *
   * @type {*}
   * @memberof ExitEditingCellEventArgs
   */
  #editor: any = null;

  /**
   *  Cell being edited
   *
   * @readonly
   * @type {*}
   * @memberof ExitEditingCellEventArgs
   */
  get Cell(): XamGridCell {
    return this.model;
  }

  /**
   *  Editor object
   *
   * @readonly
   * @type {*}
   * @memberof ExitEditingCellEventArgs
   */
  get Editor(): any {
    return this.#editor;
  }

  /**
   * Set Editor property.
   *
   * @memberof ExitEditingCellEventArgs
   */
  set Editor(value: any) {
    this.#editor = value;
  }
}

/**
 *  Enumeration for specifying the kind of filtering UI
 *
 * @export
 * @enum {number}
 * @wEnum Infragistics.Controls.Grids.FilterUIType
 */
export enum FilterUIType {
  None,
  FilterRowTop,
  FilterRowBottom,
  FilterMenu,
}

/**
 * A class to represent grid cells
 *
 * @export
 * @class XamGridCell
 * @wType Infragistics.Controls.Grids.Cell
 */
export class XamGridCell extends CellBase {
  #IsActive = false;
  #IsSelected = false;
  /**
   * @wIgnore
   */
  _style: RuntimeStyleInfo = null;

  /**
   * Key for the cell
   *
   * @type {string}
   * @memberof XamGridCell
   */
  key: string;
  get gridComponent(): any {
    return this.Row.ColumnLayout.Grid?.gridComponentInstance?.grid;
  }

  /**
   * Returns the index of the cell in the grid when is visible in the viewport otherwise returns -1
   *
   * @private
   * @return {*}  {number}
   * @memberof XamGridCell
   */
  private visibleIndex(): number {
    return (
      this.gridComponent.getColumnByName(this.Column?.Key)?.visibleIndex ?? -1
    );
  }

  /**
   * Determines if the editor style was resolved
   *
   * @memberof XamGridCell
   */
  EditorStyleResolved: RuntimeStyleInfo = null;

  /**
   *  Determines if this cell is active
   *
   * @memberof XamGridCell
   */
  get IsActive(): boolean {
    return this.Row.ColumnLayout.Grid.ActiveCell == this;
  }

  /* istanbul ignore next */
  set IsActive(value: boolean) {
    if (value) {
      this.Row.ColumnLayout.Grid.ActiveCell = this;
    } else {
      this.Row.ColumnLayout.Grid.ActiveCell = null;
      this.Row.ColumnLayout.Grid.gridComponentInstance?.cleanActiveFromIgxGrid?.();
    }
  }

  /**
   * Determines if this cell is selected
   *
   * @memberof XamGridCell
   */
  get IsSelected() {
    return this.#IsSelected;
  }

  /* istanbul ignore next */
  set IsSelected(value: boolean) {
    if (value === this.#IsSelected) {
      return;
    }
    this.#IsSelected = value;
    const node = {
      row: this.Row?.Index,
      column: this.gridComponent?.getColumnByName(this.Column?.Key)
        ?.visibleIndex,
    };
    value
      ? this.gridComponent?.selectionService.add(node)
      : this.gridComponent?.grid?.selectionService.remove(node);
  }

  /**
   * Cell style
   *
   * @type {RuntimeStyleInfo}
   * @memberof XamGridCell
   */
  get Style() {
    return this._style;
  }

  set Style(val: RuntimeStyleInfo) {
    if (this._style !== val) {
      this._style = val;
      if (
        this.Column.ColumnLayout.Grid.gridComponentInstance?.cellStyleEnabled
      ) {
        this.Column.ColumnLayout.Grid.gridComponentInstance.cellChanged();
      }
    }
  }

  /**
   *  Cell value
   *
   * @type {unknown}
   * @memberof XamGridCell
   */
  get Value(): any {
    if (this.Row.Data == null) {
      return null;
    }
    if (this.Column.Key == null) {
      return null;
    }
    return this.Row.Data[this.Column.Key];
  }

  /**
   * Creates an instance of XamGridCell.
   * @param {RowBase} [row]
   * @param {XamGridColumnModel} [column]
   * @memberof XamGridCell
   */
  constructor(row?: RowBase, column?: XamGridColumnModel) {
    super();
    this.Row = row;
    this.Column = column;
  }
}

/**
 * An object used to represent the associated control to a cell
 *
 * @export
 * @class XamGridCellControl
 * @extends {ContentControlModel}
 */
export class XamGridCellControl extends ContentControlModel {
  /**
   * Helper property to resolve UnboundDataContext and keep unique reference for comparison
   *
   * @type {UnboundColumnDataContext}
   * @memberof XamGridCellControl
   */
  UnboundDataContextResolver: UnboundColumnDataContext;

  /**
   * Lazy load content setter
   *
   * @type {*}
   * @memberof XamGridCellControl
   */
  set LazyLoadContent(value: any) {
    this.lazyLoadContent = value;
    this.isLazyLoad = value ? true : false;
  }

  /**
   * On demand data context resolve function to recalculate DataContext each request
   *
   * @type {*}
   * @memberof XamGridCellControl
   */
  onDemandLoadDataContext: any;

  /**
   * The columns associated to the control
   *
   * @type {*}
   * @memberof XamGridCellControl
   */
  Column: any = null;

  /**
   * The cell associated to the control
   *
   * @type {*}
   * @memberof XamGridCellControl
   */
  Cell: any = null;

  /**
   * Represents the content of the Content with lazy loading
   *
   * @type {*}
   * @memberof XamGridCellControl
   */
  set Content(value: any) {
    this.setValue(XamGridCellControl.ContentProperty, value);
  }

  get Content(): any {
    if (this.isLazyLoad) {
      this.setValue(XamGridCellControl.ContentProperty, this.lazyLoadContent());
    }
    return this.getValue(XamGridCellControl.ContentProperty);
  }

  /**
   * Sets the datacontext
   *
   * @memberof XamGridCellControl
   */
  set DataContext(value: any) {
    this.setValue(XamGridCellControl.DataContextProperty, value);
  }

  /**
   * Gets the data context updated using firts the onDemandLoadDataContext
   *
   * @type {*}
   * @memberof XamGridCellControl
   */
  get DataContext(): any {
    this.refreshDataContext();
    return this.getValue(XamGridCellControl.DataContextProperty);
  }

  /**
   * Lazy load content function
   *
   * @type {*}
   * @private
   * @memberof XamGridCellControl
   */
  private lazyLoadContent: any;

  /**
   * Flag to set the content when lazy loading
   *
   * @type {boolean}
   * @private
   * @memberof XamGridCellControl
   */
  private isLazyLoad = false;

  /**
   * Refresh data context is used to be triggered internally and from child to force the XamGridCell to update
   * the DataContext
   *
   * @memberof XamGridCellControl
   */
  refreshDataContext(): void {
    if (this.onDemandLoadDataContext) {
      this.setValue(
        XamGridCellControl.DataContextProperty,
        this.onDemandLoadDataContext()
      );
    }
  }

  /**
   * Overrides the ContentChangeHandler for lazy loading initialization
   *
   * @param {DependencyPropertyChangedEventArgs} args
   * @memberof XamGridCellControl
   */
  public ContentChangeHandler(args: DependencyPropertyChangedEventArgs) {
    super.ContentChangeHandler(args);
  }
}

/**
 * An object used by the UnboundColumn to hold the DataContext for an unbound cell.
 *
 * @export
 * @class UnboundColumnDataContext
 * @wType Infragistics.Controls.Grids.UnboundColumnDataContext
 */
export class UnboundColumnDataContext implements INotifyPropertyChanged {
  /**
   * Event to indicate that a property have changed.
   *
   * @memberof UnboundColumnDataContext
   */
  public PropertyChanged: SubscriptionEvent<
    (e: any, args: { PropertyName: string }) => void
  > = new SubscriptionEvent();

  private columnKey: string;
  private rowData: any;
  private value: any;
  private valueConverter: IValueConverter;

  /**
   * The column key of the associate Column
   *
   * @memberof UnboundColumnDataContext
   */
  public get ColumnKey() {
    return this.columnKey;
  }

  public set ColumnKey(value: string) {
    this.columnKey = value;
    this.onPropertyChanged({ PropertyName: 'ColumnKey' });
  }

  /**
   * The data object associated with the row of data
   *
   * @memberof UnboundColumnDataContext
   */
  public get RowData() {
    return this.rowData;
  }

  public set RowData(value: any) {
    this.rowData = value;
    this.onPropertyChanged({ PropertyName: 'RowData' });
  }

  /**
   * The value generated by the ValueConverter.
   *
   * @memberof UnboundColumnDataContext
   */
  public get Value() {
    return this.valueConverter
      ? this.valueConverter.Convert(this.value, null, null, null)
      : this.value;
  }

  public set Value(value: any) {
    this.value = value;
    this.onPropertyChanged({ PropertyName: 'Value' });
  }

  /**
   * Creates an instance of UnboundColumnDataContext.
   *
   * @param {string} columnKey
   * @param {*} rowData
   * @param {*} value
   * @param {IValueConverter} [converter]
   * @memberof UnboundColumnDataContext
   */
  constructor(
    columnKey: string,
    rowData: any,
    value: any,
    converter?: IValueConverter
  ) {
    this.columnKey = columnKey;
    this.rowData = rowData;
    this.value = value;
    this.valueConverter = converter;
  }

  /**
   * Raises the PropertyChanged event
   *
   * @protected
   * @param {{ PropertyName: string }} info
   * @memberof UnboundColumnDataContext
   * @wMethod OnPropertyChanged
   */
  /* istanbul ignore next */
  protected onPropertyChanged(info: { PropertyName: string }): void {
    this.PropertyChanged.fire([this, info]);
  }
}

/**
 *  Collection for selected rows
 *
 * @export
 * @class SelectedRowsCollection
 * @extends {ObservableCollection<XamGridRow>}
 * @wType Infragistics.Controls.Grids.SelectedRowsCollection
 */
export class SelectedRowsCollection extends ObservableCollection<XamGridRow> {
  /**
   * Property to keep the xamGrid reference
   *
   * @type {XamGridModel}
   * @memberof SelectedRowsCollection
   * @wIgnore
   */
  Grid: XamGridModel;

  /**
   * Creates an instance of SelectedRowsCollection.
   * @param {Iterable<XamGridRow>} [initial]
   * @memberof SelectedRowsCollection
   */
  constructor(initial?: Iterable<XamGridRow>) {
    super(initial);
  }

  /**
   * Remove the row from the collection and
   * set in false the selection property of the row
   *
   * @param {XamGridRow} value
   * @return {*}  {boolean}
   * @memberof SelectedRowsCollection
   */
  remove(value: XamGridRow): boolean {
    value.SetSelected(false);
    const newEventArgs =
      new SelectionCollectionChangedEventArgs<SelectedRowsCollection>();
    newEventArgs.NewSelectedItems = new SelectedRowsCollection();
    newEventArgs.PreviouslySelectedItems = new SelectedRowsCollection(
      this.toArray()
    );
    const result = super.remove(value);
    this.gridTriggerChange(newEventArgs);
    return result;
  }

  /**
   * Remove the row from the collection by Index and
   * set in false the selection property of the row
   * @param {number} index
   * @memberof SelectedRowsCollection
   */
  removeAt(index: number): void {
    this.getItem(index).SetSelected(false);
    const newEventArgs =
      new SelectionCollectionChangedEventArgs<SelectedRowsCollection>();
    newEventArgs.NewSelectedItems = new SelectedRowsCollection();
    newEventArgs.PreviouslySelectedItems = new SelectedRowsCollection(
      this.toArray()
    );
    super.removeAt(index);
    this.gridTriggerChange(newEventArgs);
  }

  /**
   * If the grid is not null, fire the change event on the grid for the SelectedItem.
   * The change event is a built-in event that is fired whenever the grid's data changes.
   * @memberof SelectedRowsCollection
   */
  private gridTriggerChange(
    eventArgs?: SelectionCollectionChangedEventArgs<SelectedRowsCollection>
  ): void {
    if (eventArgs) {
      this.Grid?.SelectedRowsCollectionChanged.fire([this.Grid, eventArgs]);
    }
    this.Grid?.change.fire(['SelectedRowsChanged']);
  }

  /**
   * Remove all the rows from the collection and
   * set in false the selection property of each row
   * @memberof SelectedRowsCollection
   */
  clear(): void {
    this.forEach((item) => item.SetSelected(false));
    let newEventArgs = null;
    if (this.count > 0) {
      newEventArgs =
        new SelectionCollectionChangedEventArgs<SelectedRowsCollection>();
      newEventArgs.NewSelectedItems = new SelectedRowsCollection();
      newEventArgs.PreviouslySelectedItems = new SelectedRowsCollection(
        this.toArray()
      );
    }
    super.clear();
    this.gridTriggerChange(newEventArgs);
  }

  /**
   * Add the row to the collection and
   * set in true the selection property of the row
   * @param {XamGridRow} value
   * @memberof SelectedRowsCollection
   */
  add(value: XamGridRow): void {
    value.SetSelected(true);
    const newEventArgs =
      new SelectionCollectionChangedEventArgs<SelectedRowsCollection>();
    newEventArgs.NewSelectedItems = new SelectedRowsCollection([value]);
    newEventArgs.PreviouslySelectedItems = new SelectedRowsCollection(
      this.toArray()
    );
    super.add(value);
    this.gridTriggerChange(newEventArgs);
  }

  /**
   * Add the rows to the collection by index and
   * set in true the selection property of each row
   * @param {Iterable<XamGridRow>} values
   * @memberof SelectedRowsCollection
   */
  addRange(values: Iterable<XamGridRow>): void {
    const newEventArgs =
      new SelectionCollectionChangedEventArgs<SelectedRowsCollection>();
    newEventArgs.NewSelectedItems = new SelectedRowsCollection([...values]);
    newEventArgs.PreviouslySelectedItems = new SelectedRowsCollection(
      this.toArray()
    );
    super.addRange(values);
    this.forEach((item) => item.SetSelected(true));
    this.gridTriggerChange(newEventArgs);
  }
}

/**
 *  Event arguments for changed in the selection collection
 *
 * @export
 * @class SelectionCollectionChangedEventArgs
 * @template T
 * @wType Infragistics.Controls.Grids.SelectionCollectionChangedEventArgs`1
 */
export class SelectionCollectionChangedEventArgs<T> {
  NewSelectedItems: T;
  PreviouslySelectedItems: T;
}

/**
 *  Event arguments for column resizing (cancellable)
 *
 * @export
 * @class CancellableColumnResizingEventArgs
 * @extends {CancellableEventArgs}
 * @wType Infragistics.Controls.Grids.CancellableColumnResizingEventArgs
 */
export class CancellableColumnResizingEventArgs extends CancellableEventArgs {}

/**
 * Find the column by key
 *
 * @param {string} key The key of the column to find
 * @param {*} data The data to search in
 * @return {*}  {XamGridColumnModel} The column found
 */
function findColumn(key: string, data): XamGridColumnModel {
  for (const column of data) {
    if (column.Key === key) {
      return column;
    }
  }
  return null;
}

result-matching ""

    No results matching ""