This project has moved and is read-only. For the latest updates, please go here.

Want to add results to a listview control

Mar 31, 2010 at 11:30 PM
Edited Mar 31, 2010 at 11:30 PM
Hi I am trying to add the results from the following query to a list box. It adds the results but all I see in the ui is image place holders. Can someone please tell me how to format the output. var twitterCtx = new TwitterContext(); var publicTweets = from tweet in twitterCtx.Status where tweet.Type == StatusType.Public select tweet; publicTweets.ToList().ForEach( tweet =>ultraListView1.Items.Add( tweet.User.Name, tweet.Text));
Apr 1, 2010 at 1:59 AM


The image is a URL that you can find at tweet.User.ProfileImageUrl.  Not sure what an ultraListView1 is, but if I had to guess, you might want to make a change similar to this:

publicTweets.ToList().ForEach( tweet =>ultraListView1.Items.Add(tweet.User.ProfileImageUrl, tweet.User.Name, tweet.Text));

And make sure that your ultraListView1 template specifies the ProfileImageUrl in a UI image control/column that can accept and render an HTTP address. 

Hope this helps,


Apr 1, 2010 at 2:59 AM
Hi it still is doing the same thing. I even tried it with a basic listview.
Apr 1, 2010 at 3:09 AM
Also can you tell me how to pass the username and password with a query. Because I have the oauth working but it is still not authenticating me when I need to have authentication. When I try to use anything that needs authentication it gives me an unauthorized exception.
Apr 1, 2010 at 6:57 PM

There's a sample application in the solution called LinqToTwitterWebFormsDemo.  It uses OAuth and populates a ListView.

BTW, you may want to download the latest release because there was a OAuth bug that's been fixed.