This is a migrated thread and some comments may be shown as answers.

problem with dropdownlist in from template in edit mode

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
karyjon
Top achievements
Rank 1
karyjon asked on 26 Sep 2009, 08:02 AM
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.

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 01 Oct 2009, 06:40 AM
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.
Tags
Grid
Asked by
karyjon
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or