/// <summary> /// Constructor /// </summary> /// <param name="p_EnableSort">True to enable sort, otherwise false.</param> /// <param name="p_RangeToSort">If null and p_EnableSort is true then the range is automatically calculated.</param> /// <param name="p_HeaderRange">If null and p_EnableSort is true then the range is automatically calculated.</param> /// <param name="p_BehaviorResize"></param> /// <param name="p_BehaviorButton"></param> /// <param name="p_BehaviorUnselectable"></param> public ColumnHeader(bool p_EnableSort, IRangeLoader p_RangeToSort, IRangeLoader p_HeaderRange, Resize p_BehaviorResize, Button p_BehaviorButton, Unselectable p_BehaviorUnselectable) { m_bEnableSort = p_EnableSort; if (p_EnableSort) { m_HeaderRange = p_HeaderRange; m_RangeToSort = p_RangeToSort; } else { m_HeaderRange = null; m_RangeToSort = null; } m_Resize = p_BehaviorResize; SubModels.Add(m_Resize); SubModels.Add(p_BehaviorButton); SubModels.Add(p_BehaviorUnselectable); }
/// <summary> /// Initializes a new instance of the <see cref="ColumnHeaderBehaviorModel"/> class. /// </summary> /// <param name="p_EnableSort">True to enable sort; otherwise <c>false</c>.</param> /// <param name="p_RangeToSort">If null and p_EnableSort is true then the range is automatically calculated.</param> /// <param name="p_HeaderRange">If null and p_EnableSort is true then the range is automatically calculated.</param> /// <param name="p_BehaviorResize">The resize behaviour.</param> /// <param name="p_BehaviorButton">The button behaviour.</param> /// <param name="p_BehaviorUnselectable">The behavior unselectable.</param> public ColumnHeaderBehaviorModel( bool p_EnableSort, IRangeLoader p_RangeToSort, IRangeLoader p_HeaderRange, ResizeBehaviorModel p_BehaviorResize, ButtonBehaviorModel p_BehaviorButton, UnselectableBehaviorModel p_BehaviorUnselectable) { doEnableSort = p_EnableSort; if (p_EnableSort == true) { headerRange = p_HeaderRange; rangeToSort = p_RangeToSort; } else { headerRange = null; rangeToSort = null; } resize = p_BehaviorResize; SubModels.Add(resize); SubModels.Add(p_BehaviorButton); SubModels.Add(p_BehaviorUnselectable); }
/// <summary> /// Constructor /// </summary> /// <param name="p_RangeToSort">If null then the range is automatically calculated.</param> /// <param name="p_HeaderRange">If null then the range is automatically calculated.</param> public SortableHeader(IRangeLoader p_RangeToSort, IRangeLoader p_HeaderRange) { m_HeaderRange = p_HeaderRange; m_RangeToSort = p_RangeToSort; }
/// <summary> /// Sort a range of the grid /// </summary> /// <param name="p_RangeToSort">Range to sort</param> /// <param name="keyColumn">Index of the column relative to the grid to use as sort keys, must be between start and end col of the range</param> /// <param name="p_bAsc">Ascending true, Descending false</param> /// <param name="p_CellComparer">CellComparer, if null the default comparer will be used</param> public void SortRangeRows(IRangeLoader p_RangeToSort, int keyColumn, bool p_bAsc, IComparer p_CellComparer) { Range l_Range = p_RangeToSort.GetRange(this); SortRangeRows(l_Range, keyColumn, p_bAsc, p_CellComparer); }
/// <summary> /// Sort a range of the grid /// </summary> /// <param name="p_RangeToSort">Range to sort</param> /// <param name="p_AbsoluteColKeys">Index of the column relative to the grid to use as sort keys, must be between start and end column of the range</param> /// <param name="p_bAsc">Ascending true, Descending false</param> /// <param name="p_CellComparer">CellComparer, if null the default comparer will be used</param> public void SortRangeRows(IRangeLoader p_RangeToSort, int p_AbsoluteColKeys, bool p_bAsc, IComparer p_CellComparer) { Range l_Range = p_RangeToSort.GetRange(this); SortRangeRows(l_Range, p_AbsoluteColKeys, p_bAsc, p_CellComparer); }