Search for:
Sign in
Register
Menu
Articles
Questions & Answers
Download
Documentation
Support
Marketplace
Old Forums
Search:
Search text
Technical support
This forum is closed.
Version 1.x
>
Technical support
>
Bug in Displaying Hierarchical (Nested) Repeater Sample?
View modes:
View mode
Threaded
Flat - newest to oldest
Flat - oldest to newest
Member
argodev
-
3/6/2006 4:28:40 PM
Bug in Displaying Hierarchical (Nested) Repeater Sample?
I've been working on a page that utilizes functionality similar to that of the nested repeater example in the CHM file. I believe I've come across a bug in the C# sample included and I thought I'd post it here in case it is a help to anyone else...
The sample code that is supposed to be included in your aspx page includes a line that looks like this:
<asp:repeater id="ChildRepeater" runat="server" datasource='<%# Container.DataItem.Row.GetChildRows("myrelation") %>' >
However, this doesn't work (at least in C# 2.0). You will get an error indicating that object of type "object" doesn't support a property called rows. This is caused by the fact that DataItem is not strongly typed. If you review online samples such as http://support.microsoft.com/default.aspx?scid=kb;EN-US;306154 you will note that you have to cast the DataItem property as a DataRowView as in the following:
<asp:repeater id="ChildRepeater" runat="server" datasource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("myrelation") %>' >
Guest
admin
-
3/7/2006 5:30:26 PM
Re: Bug in Displaying Hierarchical (Nested) Repeater Sample?
Hi Rob,
Thank you for the post. We will check this and if we find some issue with C# 2.0, we will fix it in the documentation.
Best Regards,
Guest
admin
-
3/8/2006 5:43:38 PM
Re: Bug in Displaying Hierarchical (Nested) Repeater Sample?
Rob,
we have just fixed this in the documentation for 1.8c. It was caused by the differences in VB.NET and C# syntax.
Thank you very much for notifying us about this issue.
Best Regards,
Top