This is a migrated thread and some comments may be shown as answers.

Why is column sequence sorting alphabetically?

2 Answers 61 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 17 Aug 2014, 04:01 PM
I have the results of a WCF class feeding as the data binding source into my RadListView Details type list.

[code]
List<WcfService.MyClass> _MyClassList = _WcfClient.MyResults_List(ID);
rlstResults.DataSource = _RandomPrizeRecipientList;
rlstResults.ValueMember = "ResultID";
rlstResults.DisplayMember = "FirstName";
[/code]

My fields are in a specific order in the class, but it appears to take them all and alphabetize them in the list.
The ROWS are sorting by the specified ValueMember, but the COLUMNS shift into alphabetical order.

Instead of:

ResultID  >  FirstName  >  LastName  >  Address  >  Contact

They show up in the list as:

Address  >  Contact  > FirstName  >  LastName  >  ResultID

How can I make the data view keep the columns in the original order, or alternatively set them manually according to the column names from the class?







2 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 17 Aug 2014, 04:07 PM
Never mind.  I just changed the output from the WCF to a DataTable, and it's all good.
Easy = Better.
0
Stefan
Telerik team
answered on 18 Aug 2014, 09:45 AM
Hi Peter,

Thank you for writing.

I am glad you have solved this case. Just for reference, I have tested this scenario and the columns in the control appear just as they are in the data source, so I assume that the list returned by this method: _WcfClient.MyResults_List(ID); is already sorted.

I hope this helps.

Regards,
Stefan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ListView
Asked by
Peter
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or