private void AddMoveButtons(TableCell tableCell, IVwbColumn column) { if (column == _articleCheckboxes || column == _articleNumberColumn || column == _titleColumn) { return; } if (!_query.ColumnKeysInOrder.Any()) { return; } if (column.Key() != _query.ColumnKeysInOrder.FirstOrDefault()) { var link = new HyperLink { CssClass = "moveleft" }; var query = _query.Clone(); query.MoveColumnLeft(column.Key()); link.Attributes.Add("href", GetUrlForQuery(query)); tableCell.Controls.Add(link); } if (column.Key() != _query.ColumnKeysInOrder.Last()) { var link = new HyperLink { CssClass = "moveright" }; var query = _query.Clone(); query.MoveColumnRight(column.Key()); link.Attributes.Add("href", GetUrlForQuery(query)); tableCell.Controls.Add(link); } }
private void LinkButtonToSortColumn(HyperLink link, IVwbColumn column) { var q = _query.Clone(); if (q.SortColumnKey == column.Key()) { q.Descending = !_query.Descending; } else { q.SortColumnKey = column.Key(); q.Descending = false; } var clas = q.Descending ? " descending-active" : null; link.CssClass += clas; link.Attributes.Add("href", GetUrlForQuery(q)); }
private TableCell GetTableHeaderCell(IVwbColumn col) { var tableCell = new TableCell { Text = col.GetHeader() }; tableCell.Controls.Add(new Label { Text = col.GetHeader() }); if (col != _articleCheckboxes && col != _articleNumberColumn && col != _titleColumn) { var linkButton = new HyperLink { CssClass = "right space" }; var q = _query.Clone(); q.ColumnKeysInOrder.Remove(col.Key()); linkButton.Attributes.Add("href", _page.Request.ServerVariables["URL"] + "?" + q.GetQueryString()); tableCell.Controls.Add(linkButton); } return(tableCell); }