Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7782767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:38:36+00:00 2026-06-01T19:38:36+00:00

Im writing an Rss reader. My question is: can I sort by category if

  • 0

Im writing an Rss reader. My question is: can I sort by category if im using syndicationfeed? the idea is for the feed to already be sorted when it is displayed in listbox. Sort and display on 1 predefined category only.

Im a new programer so Im working on this MSDN example: http://msdn.microsoft.com/en-us/library/hh487167(v=vs.92).aspx

RSS feed i’m using is: http://www.zimo.co/feed/


UPDATE:

my new try to solve but fail:

private void UpdateFeedList(string feedXML)
    {
        StringReader stringReader = new StringReader(feedXML);
        XmlReader xmlReader = XmlReader.Create(stringReader);
                                                              //problem below (I do not get sort method)
        SyndicationFeed feed = SyndicationFeed.Load(xmlReader).Categories.sort();


        Deployment.Current.Dispatcher.BeginInvoke(() =>
        {
           //binding listbox with feed items
            ls_text.ItemsSource = feed.Items;



        });
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:38:38+00:00Added an answer on June 1, 2026 at 7:38 pm

    UPDATE
    I dug deeper into this. First of all, it makes no sense to me to order items by categories just because every item has more than one category. As you indicated below, you were interested in filtering. Here is how I did that (the code goes into the UpdateFeedList event):

    //same code as in the example
    SyndicationFeed feed = SyndicationFeed.Load(xmlReader);
    
    //I pull out the distinct list of categories from the entire feed
    //You might want to bind this list to a dropdown on your app
    //so that users can select what they want to see:
    List<string> cats = new List<string>();
    foreach (SyndicationItem si in feed.Items)
        foreach(SyndicationCategory sc in si.Categories)
           if (!cats.Contains(sc.Name))
              cats.Add(sc.Name);
    
    //Here I imagined that I want to see all items categorized as "Trendy"
    SyndicationCategory lookingFor = new SyndicationCategory("Trendy");
    
    //and I create a container where I could copy all "Trendy" items:
    List<SyndicationItem> coll = new List<SyndicationItem>();
    
    //And then I start filtering all items by the selected tag:
    foreach (SyndicationItem si in feed.Items)
    {
         foreach (SyndicationCategory sc in si.Categories)
             if (sc.Name == lookingFor.Name)
             {
                        coll.Add(si);
                        break;
             }
    }
    
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    {
        // Bind the filtered of SyndicationItems to our ListBox.
           feedListBox.ItemsSource = coll;
    
           loadFeedButton.Content = "Refresh Feed";
    });
    

    WHATEVER BELOW IS INCORRECT

    yoursyndicationfeed.Categories.Sort()
    

    I personally would not be sorting an RSS feed by anything except for the date descending (it should be sorted so already) because an RSS feed gives me the updates for the web site content in the reverse order of them being published and that I how most people are used to see it 🙂

    Another update (also incorrect :))

    Ok, so I still don’t have the code for that app in front of me, but digging around documentation (that I mentioned in the comments), here is what you can do:

    SyndicationFeed feed = SyndicationFeed.Load(xmlReader); 
    feed.Items.OrderBy(x => x.Category);
    

    The idea is that feed.Items is a List of your elements. So treat it like a list, sort it by the property that you need.

    Oh, also, I saw your other question on the RSS reader, do you have to use the sample? Scott Guthrie wrote an RSS client for Windows Phone 7, his implementation seems a bit simpler. It depends on your needs, of course.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an app the gets information off an RSS feed, parses it using
I was writing a generic class to read RSS feed from various source and
I'm writing an RSS reader for Android. I've faced a certain difficulty which the
I am new with Scala and I am writing a simple rss reader. I
I'm writing an RSS feed. Let's say it's for a list of entries as
I'm planning on writing a RSS Feed Aggregator with a team, but I'm wondering
I am writing a very simple RSS reader - all it needs to do
I'm writing an RSS reader in python as a learning exercise, and I would
I am writing a Persian RSS reader. for reading RSS, I use Chilkat free
I'm writing a RSS feed in django. I give the item tag a link

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.