Contents tagged with ToString

  • Override ToString() in your Classes

    One of the reasons I love teaching is because of the questions that I get from attendees. I was giving a presentation at DevConnections and was showing a collection of Product objects. When I hovered over the variable that contained the collection, it looked like Figure 2. As you can see in the collection, I have actual product names of my videos from being displayed. To get your data to appear in the data tips you must override the ToString() method in your class.