sorting

C# DataGridView sorting with Generic List as underlying source

Hi! I'm using a Windows Forms DataGridView to display a generic list of MyObject objects. First of all I wrap this collection into a BindingSource Collection, then: dataGridView.DataSource = myBindingSource; What I want to do is allow the user to sort the columns by clickin on the header of the column representing a concrete Propert...

How to implement a custom ColumnSorter with ScrollTable (GWT-incubator)

I've implemented my custom column sorter which is used to sort the elements in my table. class FileColumnSorter extends SortableGrid.ColumnSorter { @Override public void onSortColumn(SortableGrid sortableGrid, TableModelHelper.ColumnSortList columnSortList, SortableGrid.ColumnSort...

Does ICU handle the collation of a list of strings of varying languages?

My application may have strings comprised of different alphabets / languages in a single list. I can't seem to find any information on what the correct method for sorting these should be or any indication that ICU supports this functionality. Example List: Apple яблоко μήλο Baby βρέφος ребенок ...

Custom Sorting on a DataGridView

I found a few questions similar to this one here on SO, but none that matched this problem, so here we go. I've got a DataGridView showing members of a team. All the team members have an assigned role within the team listed in one of the columns. Examples could something like be "Legal Representative", "Account Manager", "Assistant Acco...

Sorting a vector of custom objects

How does one go about sorting a vector containing custom (i.e. user defined) objects. Probably, standard STL algorithm sort along with a predicate (a function or a function object) which would operate on one of the fields (as a key for sorting) in the custom object should be used. Am I on the right track? ...

How to Get Records to Display in the way I need

All, I have a result set with a parent "YourName" record and parent "module_viewed" records. I also have multiple child records, "modules_completed" per parent record. What I need is to be able to display in one horizontal row "YourName", "module_viewed", and then the several "modules_completed" records associated with each of these pa...

Sorting a Doubly Linked List C++ Question

Trying to do it through a loop that traverses through the list. In the loop im feeding the head node into a sorting function that I have defined and then im using strcmp to find out if which name in the node should come first. Its not working because writing the names too early. Im comparing them all linearly by going down the list ...

How to get proper row index values of grid view after sorting

Hi, I have an asp.net application in which I am using a grid view. Paging and sorting are applied to the grid view.One action what I am doing is on click of any grid view row, am getting the column values of the selected row and redirecting to the other page. The problem is after the grid view is sorted,if I click on any of the row in ...

How to sort nearly sorted array in the fastest time possible? (Java)

I have an array of values which is almost, but not quite sorted, with a few values displaced (say, 50 in 100000). How to sort it most efficiently? (performance is absolutely crucial here and should be way faster than O(N)). I know about smoothsort, but I can't find Java implementation. Does anyone know whether it is already implemented?...

python: combine sort-key-functions itemgetter and str.lower

Hi, I want to sort a list of dictionaries by dictionary key, where I don't want to distinguish between upper and lower case characters. dict1 = {'name':'peter','phone':'12355'} dict2 = {'name':'Paul','phone':'545435'} dict3 = {'name':'klaus','phone':'55345'} dict4 = {'name':'Krishna','phone':'12345'} dict5 = {'name':'Ali','phone':'5345...

Binding Entities to a Windows DataGridView

I have an EF source that I'm binding to a DataGridView. The binding is happening programatically. However, the sorting is not working. So I decided to mess with some code and create an Extension Method, but it seems like its still not working. public static class BindingListEntityExtension { public static BindingList<T> ToBindingLi...

C# Listview sort succesful but trying to move scrollbar to top...how?

Sorted the listview and tried to "refresh" it by selecting the first element and thus putting the scroll position at the top but it's not quite working. Here's my code: if(lv_sets.SelectedItems.Count > 0) { lv_sets.SelectedItems[0].Selected = false; } if (columnSorter.SortingOrder == SortOrder.Ascending) { columnSorter.Sorting...

Extending IEnumerable to Return BindingList

In a previous question on Stack Overflow, I had run into an issue with returning an EF query to the DataGridView. Of course I'd run into an issue. However, I added an extension method that still has me baffled since it isn't working. It seems like it should, but for some reason it's not. public static class BindingListEntityExtension { ...

How to sort alphabetically but respecting groups or symbols?

What I would like to do is to sort a list of textual identifiers (think of a file name for example). The sorting algorithm I'm looking for is a kind of alphabetic sorting, but taking groups into account. For example, sorting "D1" to "D21" should be: D1, D2, D3, ..., D21 And not: D1, D10, D11, D12, ... D2, D20, D21, D3, ... I've been...

XSLT applied to XML doc with xmlns attribute

I'm applying an XSLT stylesheet to the following XML file: <top xmlns="http://www.foo.com/bar"&gt; <elementA /> <elementB /> <contents> <contentitem> <id>3</id> <moretags1 /> <moretags2 /> </contentitem> <contentitem> <id>2</id> ...

How to sort by project name in Visual Studio 2008?

I have one solution with 3 folders (Forms, Notices, Reports). In the Notice folder I have about 100 projects. The problem is, they are ordered by the creation date; while I would prefer that they were ordered by name. I have seen that this does change, by sorting alphabetically, if I add a new project within the folder. But, once I clos...

Order By varbinary column that holds docx files

I'm using MS SQL 2008 server, and I have a column that stores a word document ".docx". Within the word document is a definition (ie: a term). I need to sort the definitions upon returning a dataset. so basically... SELECT * FROM DocumentsTable Order By DefinitionsColumn ASC. So my problem is how can this be accomplished, the binary c...

calling uniq and sort in different orders in shell

is there a difference in the order of uniq and sort when calling them in a shell script? i’m talking here about time- and space-wise. grep 'somePattern' | uniq | sort vs. grep 'somePattern' | sort | uniq a quick test on a 140 k lines textfile showed a slight speed improvement (5.5 s vs 5.0 s) for the first method (get uniq values a...

Sort question in Smarty in combination with eval

Smarty is used to render a select and handle the localization: <select name="divisions"> {section name=i loop=$divisions} {assign var='name' value=$divisions[i].name} {assign var='code' value=$divisions[i].code} <option value="{$code}" {if $user.division == $code}selected=yes{/if}> {eval var=$nam...

Sorting TListbox -- Highs and Lows

Okay, I have a TListBox that on occasion may be called upon to show 43,000 lines! I know, this hardly ever makes any sense, but there it is. Now here's the current problem: Using the built-in Sort method, with its Compare callback function, takes nearly forever, like many minutes. So I extract the strings out of the listbox into a p...