Questions tagged [sortdirection]

SortDirection is a generic term used in various technologies to specify the sorting direction of the items in a list, grid, etc.

WPF: DataGridColumn.SortDirection gets or sets the sort direction (ascending or descending) of the column. It is used to queue the visual arrow in the DataGridColumnHeader to point up, down, or to not show.

Windows Forms: BindingSource.SortDirection gets the direction the items in the list are sorted.

ASP.NET: GridView.SortDirection gets the sort direction of the column being sorted.

18 questions
13
votes
4 answers

DataGrid SortDirection ignored

I want to specify a default ordering at startup, but still allow the user to sort by clicking on the column headers. Sadly the SortDirection property is ignored when it is set - i.e. we get the correct column header arrow, but nothing is…
Voo
  • 26,852
  • 9
  • 70
  • 145
11
votes
3 answers

wpf set sorting programmatically, so that the header is toggled as sorted

I have a problem with a wpf toolkit DataGrid. I have an ItemsSource with three columns: FirstName LastName Address In the C# codebehind I set the sort direction and which column to sort on like this: ICollectionView view =…
Cinaird
  • 755
  • 4
  • 13
  • 33
6
votes
3 answers

Linq Sort Direction From String

I am trying to sort a set of Users. I have access to the sorting property and direction (asc, desc). My current order by query is below. But as you can see it doesn't account for the sort direction. How do can I build this expression without having…
zzz
  • 159
  • 1
  • 8
6
votes
4 answers

DataGridViewColumn initial sort direction

I'm working in VS2008 on a C# WinForms app. By default when clicking on a column header in a DataGridView it sorts that column Ascending, you can then click on the column header again to sort it Descending. I am trying to reverse this, so the…
lnediger
  • 1,280
  • 2
  • 12
  • 14
4
votes
2 answers

Asp.NET 4.0 GridView Default Sort Direction & Expression

Asp.net 4.0 gridView's built in support for "sort arrows" saves some code. All my grids are sorted by default when they're returned from the database, so it would seem logical that I should indicate which column is default sorted on by using the…
philw
  • 571
  • 8
  • 18
2
votes
2 answers

jqGrid allow only 1 sort direction

jqGrid's sort icon on the column header shows both up and down arrows. Is there a way to force the icon to show only 1 direction like only allowing ascending order? Thanks.
Niner
  • 1,710
  • 5
  • 33
  • 42
1
vote
3 answers

How to set SortDirection of a WPF datagrid as Ascending on datagrid initialization

I have a simple datagrid which can be sorted by clicking the column header. When I open the window, datagrid is not sorted. Then, when I click, arrow appears and it's sorted asc, click again - sorted desc etc. very simple. What I need to do, is to…
Marshall
  • 1,175
  • 6
  • 29
  • 47
1
vote
1 answer

DataGrid header sort direction icon

How can i display custom sort direction image in wpf datagrid header? I use this style in my datagrid. How can I add images for ascending and descending sort directions?