When a Gridview uses an object data source, that object may contain other objects.

How do I display a single value from the embedded object in my Gridview?

For example, I have a list of order line objects that I want to display in a GridView. The order line object contains another object which is product. But in my GridView, I only want to list the product name.

          <asp:GridView ID=gridView1 runat=server ....  
          <asp:TemplateField HeaderText=" Product"> 
                   <asp:TextBox ID=Product runat=server 
                            Text= <%# Eval(" Product.ProductName ") %> >

Copyright © 2006-2018, LQSystems,Inc. All rights reserved.

   Printer Friendly Page