Apr 25, 2011 at 6:25 PM
Edited Apr 25, 2011 at 6:27 PM
I'm currently making an application using linq2twitter. I handled the first steps without difficulties.
Authentication is doing well, the querying as well.
But now i'd like to display tweets in a gridview :
context = new TwitterContext(auth);
TweetCollection collection = new TweetCollection();
var tweets = from tweet in context.Status where tweet.Type == StatusType.Friends select tweet;
foreach (var tweet in tweets)
DisplayedTweetModel model = new DisplayedTweetModel();
model.userID = tweet.User.UserID;
model.statusID = tweet.StatusID;
model.imgUrl = tweet.User.ProfileImageUrl;
model.screenName = tweet.User.ScreenName;
model.createdAt = tweet.CreatedAt;
model.text = tweet.Text;
GridView1.DataSource = collection.getListTweet();
The class DisaplayedTweetModel is from my own and TweetCollection is another classe I created that contains an IList containing tweets.
I need UserID and ScreenName data for each tweet but they are empty. If I use tweets as Datasource same thing, no UserID and ScreenName data.
tweet.User.UserID and tweet.User.ScreenName are empty