sortdirection

DataGridViewColumn initial sort direction

谁说我不能喝 提交于 2020-01-23 06:33:08
问题 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 initial click sorts Descending then the second click sorts Ascending and I haven't been able to figure out how to do this. Does anyone know? Thanks 回答1: You can set the HeaderCell SortGlyphDirection to Ascending, and then the next click will give you the

jqGrid allow only 1 sort direction

丶灬走出姿态 提交于 2019-12-23 00:51:54
问题 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. 回答1: Check out the jqGrid Event documentation here. You could define your own sorting by returning 'stop' on the onSortCol event. Something like this should work: onSortCol: function (index, iCol, sortorder) { if (sortorder === "desc") { return 'stop'; } else { //do regular sorting. } } Also if you do this on gridComplete

Gridview: capturing sort direction

怎甘沉沦 提交于 2019-12-11 05:35:12
问题 I have a gridview in an updatepanel with sorting enabled and an event handler as follows: protected void MyGridSort(object sender, GridViewSortEventArgs e) { var TheDirection = (e.SortDirection).ToString(); var TheColumn = (e.SortExpression).ToString(); } I put a breakpoint just after these lines. Every time I press the column header, my variable TheDirection is always showing Ascending. Why is it not toggling from ascending to descending and back? Thanks. 回答1: You could keep the direction in

Linq Sort Direction From String

扶醉桌前 提交于 2019-12-10 13:22:25
问题 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 to use Dynamic Linq, or adding another set of statements for "asc" or "desc" sort direction. public override IQueryable<DalLinq.User> GetSort(IQueryable<DalLinq.User> query) { //SelectArgs.SortDirection <- Sort Direction switch (SelectArgs

DataGrid SortDirection ignored

那年仲夏 提交于 2019-12-10 12:32:19
问题 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 sorted. Clicking on the headers manually, sorts the data correctly, so it's not the sorting itself. This is the simplified version I'm using: <DataGrid ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path

jqGrid allow only 1 sort direction

浪尽此生 提交于 2019-12-06 14:01:19
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. Check out the jqGrid Event documentation here . You could define your own sorting by returning 'stop' on the onSortCol event. Something like this should work: onSortCol: function (index, iCol, sortorder) { if (sortorder === "desc") { return 'stop'; } else { //do regular sorting. } } Also if you do this on gridComplete it should hide the descending arrows: gridComplete: function () { $('.ui-grid-ico-sort.ui-icon-desc.ui-sort