DropDownList in GridView EditItemTemplate with related field mapped

Posts   
 
    
Gianc1412
User
Posts: 40
Joined: 30-Oct-2007
# Posted on: 27-May-2008 05:58:54   

I have a DropDownList in the EditItemTemplate of a GridView. Im using LLBLGENPRO Datasources for both the GridView and The DropDownList. The EntityCollection for the GridView Datsource has related fields mapped (Project - ProjectPreset m:1). It one way binds fine but when editing the record the change from the DropDownList is not updated in the database. I cannot update the related entity. Below is my code. How should I be doing this?


    <EditItemTemplate>
        <asp:DropDownList ID="ProgressDropDown" runat="server" DataSourceID="LLBLDS_ProgressPresets" DataTextField="ProgressPresetDescription" DataValueField="ProgressPresetID" SelectedValue='<%# Bind("ProgressPresetID") %>'>
        </asp:DropDownList>
    </EditItemTemplate>
    <ItemTemplate>
        <asp:Label ID="ProgressLabel" runat="server" Text='<%# Eval("ProgressPresetDescription") %>'></asp:Label>
    </ItemTemplate>


        <llblgenpro:LLBLGenProDataSource ID="LLBLGENDS_OpenProjectList" runat="server" DataContainerType="EntityCollection"
            EntityCollectionTypeName="BullingtonBuildersObjects.CollectionClasses.ProjectCollection, BullingtonBuildersObjects">
            <SelectParameters>
                <asp:Parameter DefaultValue="open" Name="Status" />
            </SelectParameters>
        </llblgenpro:LLBLGenProDataSource>


        <llblgenpro:LLBLGenProDataSource ID="LLBLDS_ProgressPresets" runat="server" DataContainerType="EntityCollection"
            EntityCollectionTypeName="BullingtonBuildersObjects.CollectionClasses.ProgressPresetCollection, BullingtonBuildersObjects">
        </llblgenpro:LLBLGenProDataSource>

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-May-2008 07:15:05   

Mmm disappointed I can't reproduce your issue, neither see anything obvious missing thing.

What LLBLGenPro version are you using? Could you please doble-check that your behind-code isn't interfering in the involved field?

David Elizondo | LLBLGen Support Team
Gianc1412
User
Posts: 40
Joined: 30-Oct-2007
# Posted on: 28-May-2008 02:55:50   

It was a case-sensitive typo... thanks for the quick response though.

Should be <%# Bind("ProgressPresetId") %>