Is it possible to bind complex type properties to a datagrid?

前端 未结 8 749
时光取名叫无心
时光取名叫无心 2020-12-02 15:55

How would I go about binding the following object, Car, to a gridview?

public class Car
{
   long Id {get; set;}
   Manufacturer Maker {get; set;}
}

public class         


        
8条回答
  •  猫巷女王i
    2020-12-02 16:44

    Yes, you can create a TypeDescriptionProvider to accomplish nested binding. Here is a detailed example from an MSDN blog:

    http://blogs.msdn.com/msdnts/archive/2007/01/19/how-to-bind-a-datagridview-column-to-a-second-level-property-of-a-data-source.aspx

提交回复
热议问题