Simple question on binding to complex object

6 replies. Last post: March 29, 2010 9:58 AM by Sam Tran
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Sam TranMember

Hi,

I'm trying to bind a complex object and can't figure out how to do it using WebGrid.

With a normal ASP.Net GridView control, I can do this:

<asp:TemplateField HeaderText="Sun ETID">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Sunday.ETID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>


With a Telerik RadGrid, I can do this:

<telerik:GridBoundColumn UniqueName="column3" DataField="Sunday.ETID" HeaderText="Sun ETID">
</telerik:GridBoundColumn>


My datasource is an object called "Timesheet" this is the datasource for the grids.

Within the Timesheet object is another collection of objects for each day of the week. 

That is why I can bind to "Sunday.ETID"..."Sunday" is an object within "Timesheet"

And "Sunday" has a property called "ETID".


What would be the syntax to bind a column using Intersoft WebGrid?


Thanks!


All times are GMT -5. The time now is 6:41 PM.
Previous Next