Esempio n. 1
0
        protected Task OnSortClicked(BaseDataGridColumn <TItem> column)
        {
            if (Sortable && column.Sortable)
            {
                column.Direction = column.Direction.NextDirection();

                // When using internal sorting just one column can be sorted!
                // TODO: planned for 0.9 to enable sorting for all columns
                if (!ReadData.HasDelegate)
                {
                    sortByColumn = column;

                    foreach (var col in Columns)
                    {
                        if (col.ElementId == column.ElementId)
                        {
                            continue;
                        }

                        // reset all others
                        col.Direction = SortDirection.None;
                    }
                }

                dirtyFilter = dirtyView = true;

                if (ReadData.HasDelegate)
                {
                    return(HandleReadData());
                }
            }

            return(Task.CompletedTask);
        }
Esempio n. 2
0
        protected Task OnSortClicked(BaseDataGridColumn <TItem> column)
        {
            if (Sortable && column.Sortable)
            {
                column.Direction = column.Direction == SortDirection.Descending ? SortDirection.Ascending : SortDirection.Descending;
                sortByColumn     = column;

                // just one column can be sorted for now!
                foreach (var col in Columns)
                {
                    if (col.ElementId == column.ElementId)
                    {
                        continue;
                    }

                    // reset all others
                    col.Direction = SortDirection.Ascending;
                }

                dirtyFilter = dirtyView = true;

                if (ReadData.HasDelegate)
                {
                    return(HandleReadData());
                }
            }

            return(Task.CompletedTask);
        }
Esempio n. 3
0
        /// <summary>
        /// Links the column with this datagrid.
        /// </summary>
        /// <param name="column">Column to link with this datagrid.</param>
        internal void Hook(BaseDataGridColumn <TItem> column)
        {
            Columns.Add(column);

            // save command column reference for later
            if (CommandColumn == null && column is DataGridCommandColumn <TItem> commandColumn)
            {
                CommandColumn = commandColumn;
            }
        }
Esempio n. 4
0
        protected Task OnFilterChanged(BaseDataGridColumn <TItem> column, string value)
        {
            column.Filter.SearchValue = value;
            dirtyFilter = dirtyView = true;

            if (ReadData.HasDelegate)
            {
                return(HandleReadData());
            }

            return(Task.CompletedTask);
        }
Esempio n. 5
0
        protected void OnSortClicked(BaseDataGridColumn <TItem> column)
        {
            if (Sortable && column.Sortable)
            {
                column.Direction = column.Direction == SortDirection.Descending ? SortDirection.Ascending : SortDirection.Descending;
                sortByColumn     = column;

                // just one column can be sorted for now!
                foreach (var col in Columns)
                {
                    if (col.ElementId == column.ElementId)
                    {
                        continue;
                    }

                    // reset all others
                    col.Direction = SortDirection.Ascending;
                }

                dirtyFilter = dirtyView = true;
            }
        }
Esempio n. 6
0
 protected void OnFilterChanged(BaseDataGridColumn <TItem> column, string value)
 {
     column.Filter.SearchValue = value;
     dirtyFilter = dirtyView = true;
 }
 protected bool CellAreEditable(BaseDataGridColumn <TItem> column)
 {
     return(column.Editable &&
            ((column.CellsEditableOnNewCommand && ParentDataGrid?.EditState == DataGridEditState.New) ||
             (column.CellsEditableOnEditCommand && ParentDataGrid?.EditState == DataGridEditState.Edit)));
 }
Esempio n. 8
0
 /// <summary>
 /// Links the column with this datagrid.
 /// </summary>
 /// <param name="column">Column to link with this datagrid.</param>
 internal void Hook(BaseDataGridColumn <TItem> column)
 {
     Columns.Add(column);
 }