Generally with data controls in ASP.NET that have item collections of
their own, you need to catch the item databound and populate the
collection yourself. Otherwise, at best you can simply get a
concatenated string of values by binding to the property, but it won't
populate the control.

Alternatively, you can override DataBind and do the work there I believe.

That said, I've hated this aspect of databinding for years, and would
love to hear if there's another way.

∞ Andy Badera
∞ +1 518-641-1280
∞ This email is: [ ] bloggable [x] ask first [ ] private
∞ Google me: http://www.google.com/search?q=andrew%20badera



On Thu, Oct 1, 2009 at 5:18 AM, Fred <[email protected]> wrote:
>
> Hi All,
>
>
> I have an asp repeater that displays items that have been sold.
>
>  <asp:repeater id="dgSales" runat="server">
>        <ItemTemplate>
>                <TR  class=label>
>                        <TD><asp:Label ID="Label161" runat="server" 
> CssClass="TDfieldData"><
> %#DataBinder.Eval(Container.DataItem, "PurchaseTime")%></asp:Label></
> TD>
>                        <TD><asp:Label ID="Label12" Runat="server" 
> CssClass="TDfieldData"><
> %#DataBinder.Eval(Container.DataItem, "Description")%></asp:Label></
> TD>
>                        <TD><asp:DropDownList ID="cboSalePerson" 
> runat="server"></
> asp:DropDownList></TD>
>                </TR>
>        </ItemTemplate>
> </asp:repeater>
>
> Each drop down has to be populated with the names of the sales people
> from a database and the sales person currently associated with that
> sale needs to be the selected item.
> The user then needs to be able change the sales person where required
> and save it back to the database.
>
> I am having real problem figuring out how to create the dropdown and
> link it to the sale record or even if I am going about this is the
> right way.
>
> The page is in VB Any help would be really appriciated (step by step
> if possible!)
>
> Thanks
>
> Fred
>

Reply via email to