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

前端 未结 8 730
时光取名叫无心
时光取名叫无心 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条回答
  •  眼角桃花
    2020-12-02 16:34

    Here's another option I got working:

    
        
              <%#Eval("Maker.Name")%>
        
    
    

    Might be ASP.NET 4.0 specific but it works like a charm!

提交回复
热议问题