problem with dropdownlist in from template in edit mode

2 posts, 0 answers
  1. karyjon
    karyjon avatar
    6 posts
    Member since:
    Oct 2012

    Posted 26 Sep 2009 Link to this post

    hi

    i have a telerik grid with this specification

    <telerik:RadGrid ID="RadGrid1" runat="server"  GridLines="None"
              ...  DataSourceID="sqlBranchList" OnItemDeleted="RadGrid1_ItemDeleted"
                OnItemInserted="RadGrid1_ItemInserted"
               OnItemUpdated="RadGrid1_ItemUpdated" OnItemCommand="RadGrid1_ItemCommand"
                OnPreRender="RadGrid1_PreRender" Skin="Sunset">
                <MasterTableView CommandItemDisplay="TopAndBottom" DataSourceID="sqlBranchList"
                    DataKeyNames="branchID">
                    <Columns>
                       -- Some column with Update/Insert/delete button -- 
                     
                    </Columns>
                    <EditFormSettings EditFormType="Template">
                <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                        <FormTemplate>
                            <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
                                style="border-collapse: collapse; background: white;">
                                 <tr>
    <td>

                                                <asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="true"  DataSourceID="sqlSRVUserlist" DataTextField="userName" DataValueField="userID" >
                                               <asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem>
                                                    </asp:DropDownList>
                                           </td>
                                </tr>
                            </table>
                        </FormTemplate>
                    </EditFormSettings>
                    </MasterTableView>
                
                </telerik:RadGrid>

    --------
    so i have dropdownlist in editform that fill with this datasource :

    <asp:SqlDataSource ID="sqlSRVUserlist" runat="server"
            ConnectionString="<%$ ConnectionStrings:eosWebConnectionString %>"
            SelectCommand="prcUserList" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        
       and i have this datasource for my grid.
        
        <asp:SqlDataSource ID="sqlBranchList" runat="server"
            ConnectionString="<%$ ConnectionStrings:eosWebConnectionString %>"
            SelectCommand="prcSearchBrnach" SelectCommandType="StoredProcedure"
            DeleteCommand="prcDeleteBranch" DeleteCommandType="StoredProcedure"
            InsertCommand="prcAddBranch" InsertCommandType="StoredProcedure"
            UpdateCommand="prcUpdateBranch" UpdateCommandType="StoredProcedure">
            <SelectParameters>
                <asp:Parameter DefaultValue="1" Name="branchStatus" Type="Int32" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="branchID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
            
                <asp:ControlParameter ControlID="DropDownList1" Name="userID"
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:Parameter Name="branchStatusID" Type="Int32" DefaultValue="1" />
                <asp:Parameter Name="branchID" Type="Int32" />
                <asp:Parameter Name="branchName" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:ControlParameter  Name="userID"  ControlID="RadComboBox1"
                        PropertyName="SelectedValue" Type="Int32" />
                <asp:Parameter Name="branchStatusID" Type="Int32" DefaultValue="1" />
                <asp:Parameter Name="branchName" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
       
    ------

    but when i want to update a row this error is occurred:

    Could not find control 'DropDownList1' in ControlParameter 'userID'

    ---

    i think telerik grid in edit form mode can not find controls on the page.

    please help me.
  2. Martin
    Admin
    Martin avatar
    811 posts

    Posted 01 Oct 2009 Link to this post

    Hello Karyjon,

    You can use Automatic DataSource operations. I am attaching a sample project demonstrating this approach. You can also review this online demo for more details.

    Regards,
    Martin
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top