My class structure is
public class Listings
{
public string id { get; set; }
public string title { get; set; }
public ListingsImages[] images;
}
public class ListingsImages
{
public string src { get; set; }
public string width { get; set; }
public string height { get; set; }
public string alt { get; set; }
public string num { get; set; }
public string size { get; set; }
}
I want to bind my grid view and i m binding as
List<Listings> p = getData(); //returns list of Listings
gv.DataSource = p;
gv.DataBind();
My grid view code is
<asp:GridView ID="gv" runat="server" AutoGenerateColumns=false>
<Columns>
<asp:TemplateField>
<ItemTemplate>
<%# Eval("id") %>
     
<%# Eval("title") %>
     
<%# Eval(?????)%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
One Listings object containts 10 images ! Now the problem is I want to display 6th pic of all Listings object then ?? I have tried
<%# Eval("images[5].src")%>
But it gives me error ! Kindly answer me what should be solution ? ( Just only with one gridview and one datasource)