Ejemplo n.º 1
0
        /// <summary>Selects a column for ordering. </summary>
        /// <param name="column">The column. </param>
        /// <param name="ascending">The value indicating whether to sort the column ascending; otherwise descending. </param>
        /// <returns>Returns true if column could be changed. </returns>
        public bool SelectColumn(DataGridColumnBase column, bool ascending)
        {
            if (column.CanSort)
            {
                var oldColumn = SelectedColumn;
                if (oldColumn != null)
                {
                    oldColumn.IsSelected = false;
                }

                SelectedColumn             = column;
                SelectedColumn.IsSelected  = true;
                SelectedColumn.IsAscending = ascending;

                UpdateItemsOrder();
                OnOrderChanged();

                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>Selects a column for ordering.
 /// If the column is not selected the the default ordering is used (IsAscendingDefault property).
 /// If the column is already selected then the ordering direction will be inverted. </summary>
 /// <param name="column">The column. </param>
 /// <returns>Returns true if column could be changed. </returns>
 public bool SelectColumn(DataGridColumnBase column)
 {
     return(SelectColumn(column, column == SelectedColumn ? !column.IsAscending : column.IsAscendingDefault));
 }
 internal DataGridOrderChangedEventArgs(DataGridColumnBase column)
 {
     Column = column;
 }