i use Kendo grid in ASP.NET MVC app.
I have grid with 6 columns which are sorted by date in default. User can click on header of one of the columns a override default sort and sort by column of his choosing.
What I want to achieve is "second tier sorting". When user sorts by name and there are 10 records with the same name, i want the 10 records to be sorted by date (descending). So far, I havenĀ“t found anyting useful.
Thanks
Related
I have a view panel displaying a categorized view, all my columns are sortable.
When I click to sort one of the not categorized columns the values in categorized columns are not displayed. this is normal behaviour for a sorted categorized view in IBMNotes client as well.
The problem is that I need the category values to display if the view is sorted (clicked on sort icon) or display another column containing the category values, but only if the view is sorted.
How can I accomplish this?
First option: use more views with different sort setting in columns after category column. Dynamically change the view name. This works as you want, but it has performance impact on server and I don't recommend it.
Second option: use hide when on redundant (flat) column based on sort options. Exact formula depends on your implementation (submit page code).
I am working on Windows Form app using C#. I have a gridview on my form that will contain 5 columns for Sr No, Item Name, Item Price, Item Qty and Item Amount. I want to have a set of five textboxes in the last row of my gridview so that I can enter my required values there and then upon entering the last value, the wholw row comprising of all the five items should get added to the gridview and again the last row should contains that set of textboxes for a newer entry. How can I achieve this?
Also is it possible to have the entries made in the gridview itself? I need to fetch entries from DB and after the user is done, the gridview entries will be stored again in the DB.
Please note that my app is WPF but for ease I have used Windows Form for just this Window.
I have a category "Year" in Tridion and it has keyword values listed 1900s-2012. I am trying to access the category in a component via a dropdownlist. The problem is, I am seeing values in dropdownlist in ascending order 1900s-2012. And user has to scroll all the way down to select the current year - 2012. Is there a way I can reorder keyword values in the category so users see the current year first. I have searched quite a bit, but found no answer on the web or in documentation.
Is it possible to specify the ordering in any dropdownlist created from a category used in a component or at the schema level?
There is no way to specify the order for a dropdown list without creating an eXtension (should be easy using jQuery).
What you could do is set the default value of the field to "2012" and that way the user has the current year selected and if they need to change to a previous year, they'll scroll up.
I want to fix some columns so that user cannot drag and drop these columns and cannot reorder these columns also.Is it doable how can i do it.
There is code inside grid.jqueryui.js that uses the jQuery UI Sortable Interaction to enable drag-and-drop columns.
The following selector determines which columns can be dragged-and-dropped:
"items": '>th:not(:has(#jqgh_'+tid+'_cb'+',#jqgh_'+tid+'_rn'+',#jqgh_'+tid+'_subgrid),:hidden)',
So basically the selector will choose any column header that is not hidden and does not satisfy one of the following criteria:
#jqgh_'+tid+'_cb' - A checkbox column (for multi-select)
#jqgh_'+tid+'_rn' - A row number column (for primary key?)
#jqgh_'+tid+'_subgrid - A subgrid column
To satisfy your request, jqGrid would have to be modified to populate the items selector with blacklisted columns. Maybe the blacklisted columns could be flagged using a new colmodel option. This is all do-able, but requires changes to jqGrid itself...
Is there a way to specify the default sorting direction for columns in a Telerik MVC Grid?
example: click on column 'Date' and it sorts descending, click on column 'Name' and it sorts ascending
I do not think there is a way in today's Grid to change the "cycle" order for sorting operations. By default, the Grid will cycle through these sort orders when the header is clicked:
Unsorted > Ascending > Descending
If you use the API options described by Dick, you can set the initial sort behavior, but once the column is clicked, it will "resume" the cycle. So, if you set Date to Ascending initially, the next click will sort by Descending.
This is relatively common behavior for web grids, so it meets user experience expectations.
If you want to take explicit control over sorting behavior, there is a rich client-side API that allows you to specify sort and filters directly:
var grid = $('#yourGridId').data('tGrid');
//Descendingly sort the records by the Name property
grid.filter('Name-desc');
As you can see, you can specify the property name and sort direction. You can also sort on multiple fields. See the online docs for more examples.
I suppose you can play with the OrderBy method of the Telerik MVC grid and define the sort order explicitly - at least this is what I see from the demo description here.
Dick