Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

databinder help with nested datalist

Status
Not open for further replies.

Rexxx

MIS
Oct 16, 2001
47
0
0
I have the following code:
<tr bordercolor=&quot;0&quot;>
<td valign=&quot;top&quot; class=&quot;apartmentinside&quot;>&nbsp; Members/Shareholders:</td>
<td class=&quot;apartmentinside&quot;>
<asp:DataList runat=&quot;server&quot; Id=&quot;ChildDataList4&quot; datasource='<%# Container.DataItem.Row.GetChildRows(&quot;myrelation4&quot;) %>' RepeatColumns=&quot;1&quot;>
<ItemTemplate>
<%# Container.DataItem( &quot;oname&quot; ) %><%# Container.DataItem( &quot;fname&quot; ) %>&nbsp;<%# Container.DataItem( &quot;mname&quot; ) %>&nbsp;<%# Container.DataItem( &quot;lname&quot; ) %><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Contriubtion:&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, &quot;value&quot;, &quot;{0:N0}&quot;) %>&nbsp;<%# Container.DataItem( &quot;valuetype&quot; ) %>&nbsp;<%# Container.DataItem( &quot;valuetext&quot; ) %>&nbsp;<br>
</ItemTemplate>
</asp:DataList></td>
</tr>

This databinder errors as follows:
DataBinder.Eval: 'System.Data.DataRow' does not contain a property with the name value

If I make the following change it works:
<tr bordercolor=&quot;0&quot;>
<td valign=&quot;top&quot; class=&quot;apartmentinside&quot;>&nbsp; Members/Shareholders:</td>
<td class=&quot;apartmentinside&quot;>
<asp:DataList runat=&quot;server&quot; Id=&quot;ChildDataList4&quot; datasource='<%# Container.DataItem.Row.GetChildRows(&quot;myrelation4&quot;) %>' RepeatColumns=&quot;1&quot;>
<ItemTemplate>
<%# Container.DataItem( &quot;oname&quot; ) %><%# Container.DataItem( &quot;fname&quot; ) %>&nbsp;<%# Container.DataItem( &quot;mname&quot; ) %>&nbsp;<%# Container.DataItem( &quot;lname&quot; ) %><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Contriubtion:&nbsp;&nbsp;<%# Container.DataItem (&quot;value&quot;) %>&nbsp;<%# Container.DataItem( &quot;valuetype&quot; ) %>&nbsp;<%# Container.DataItem( &quot;valuetext&quot; ) %>&nbsp;<br>
</ItemTemplate>
</asp:DataList></td>
</tr>

The property value is available until I try using databinder. What adjustment can I make to get databinder to work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top