Welcome Guest Search | Active Topics | Members | Log In | Register

GridView DataBinding to an Object Hierarchy Options · View
Jay Pondy
Posted: Sunday, October 07, 2007 7:41:23 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 07/10/2007 07:41:23
Date: Sun, 07 Oct 2007 11:41:23 -0400

Given the following List(of Position) objects for an ObjectDataSource

Position
Description
EmployeeA
FirstName
LastName
EmployeeB
FirstName
LastName

Is it possible to bind a GridView column to EmployeeA.LastName?
Jay Pondy
Posted: Sunday, October 07, 2007 12:44:17 PM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 07/10/2007 12:44:17
Date: Sun, 07 Oct 2007 16:44:17 -0400

Yes. Use a Template Column:

<asp:TemplateField HeaderText="EmployeeA">
<ItemTemplate>
<%#eval("EmployeeA.LastName") %>
</ItemTemplate>
/asp:TemplateField>


On Sun, 07 Oct 2007 11:41:23 -0400, Jay Pondy <jpondy@bellsouth.net> wrote:

>Given the following List(of Position) objects for an ObjectDataSource
>
> Position
> Description
> EmployeeA
> FirstName
> LastName
> EmployeeB
> FirstName
> LastName
>
>Is it possible to bind a GridView column to EmployeeA.LastName?
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.1 (NET v2.0) - 9/10/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.036 seconds.