How do I get my List Box to display the actual names of my properties in my entity framework data base

40 views Asked by At

My list box is showing the data but not the actual names of it here is some code I used to display it but its not showing the names.

     public void WireUpList()
    {
        FoodListBox.DataSource = GetFood();
        
    }

     
    private BindingList<Food> GetFood()
   {

        var foodList = nRIDataContext.FoodModels.ToList();
        
        var listBinding = new BindingList<Food>(foodList);

        return listBinding;


    }

        

At first I had my method as a List not a binding list and I thought that was the solution but I'm still trying to figure it out.

0

There are 0 answers