Why is column sequence sorting alphabetically?

3 posts, 0 answers
  1. Peter
    Peter avatar
    5 posts
    Member since:
    Jan 2014

    Posted 17 Aug 2014 Link to this post

    I have the results of a WCF class feeding as the data binding source into my RadListView Details type list.

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

    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. Peter
    Peter avatar
    5 posts
    Member since:
    Jan 2014

    Posted 17 Aug 2014 in reply to Peter Link to this post

    Never mind.  I just changed the output from the WCF to a DataTable, and it's all good.
    Easy = Better.
  3. DevCraft banner
  4. Stefan
    Stefan avatar
    2891 posts

    Posted 18 Aug 2014 Link to this post

    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.

    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.
Back to Top