Q: Displaying Data In C# Form Creating my first Application, I am having a lot of trouble displaying data in a form. Currently I am trying to use a ListBox to display information(someone please let me know if there is a better object for this case). Below I am posting my data object, form code, and function that returns data to my object.
How can I get my data to display in this Listbox?
Function that returns data
public AllChampions sendChampionRequest()
{
     HttpWebRequest request = (HttpWebRequest)WebRequest.Create
        ("https://na.api.pvp.net//api/lol/na/v1.2/champion" + 
     ConfigurationSettings.AppSettings["ApiKey"]);
     HttpWebResponse response = (HttpWebResponse)request.GetResponse();
     Stream receiveStream = response.GetResponseStream();
     StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
     JavaScriptSerializer js = new JavaScriptSerializer();
     var champdata = readStream.ReadToEnd();
     var allChampions = (AllChampions)js.Deserialize(champdata, typeof(AllChampions));
     response.Close();
     readStream.Close();           
     return (allChampions);           
}

Form Code Below. Champions_Box is a C# Form ListBox.
public partial class LeagueStat : Form
{
     public LeagueStat()
     {
         InitializeComponent();
     }

     private void LeagueStat_Load(object sender, EventArgs e)
     {
          var champions = new championRequest();
          var allChampions = champions.sendChampionRequest();
          Champions_Box.DataSource = allChampions;
          Champions_Box.DisplayMember = "Champions";
     }
}

Data Object
public class AllChampions
{
    public IEnumerable<Champion> Champions { get; set; }
}
public class Champion
{
    public long Id { get; set; }
    public bool Active { get; set; }
    public bool BotEnabled { get; set; }
    public bool FreeToPlay { get; set; }
    public bool BotMmEnabled { get; set; }
    public bool RankedPlayEnabled { get; set; }
}


A: According to the MDSN page on ListBox.DisplayMember property, you'll need to set the DisplayMember to one of the properties in your custom object. Since none of your current properties is a name field, you may want to consider adding that or something more useful to display than an Id.
So, for example, update your Champion class with a username like so:
public class Champion
{
    public long Id { get; set; }
    public string Username {get; set; }
    public bool Active { get; set; }
    public bool BotEnabled { get; set; }
    public bool FreeToPlay { get; set; }
    public bool BotMmEnabled { get; set; }
    public bool RankedPlayEnabled { get; set; }
}

And then reference it this way (as Bill hinted at below):
Champions_Box.DisplayMember = "Username";

For two-way data binding, consider setting the ListBox.ValueMember to one your properties such as Id as well.
Then you'd use it like so:
Champions_Box.ValueMember = "Id";

