StoredProcedure as SqlDataSource Problem

2 posts, 0 answers
  1. Marcus
    Marcus avatar
    13 posts
    Member since:
    Jan 2011

    Posted 27 May 2011 Link to this post

    If I take StoredProcedure as SqlDataSource for Combobox "RadCombobox2", I can not select a value(see Att.1). If I configure sqldatasource3(see Att.2) when I put manuelly the field entry, I get errors:

    The DataSourceID of 'cbDays' must be the ID of a control of type IDataSource.  A control with ID 'SqlDataSource3' could not be found.

    If I take instead of StoredProcedure  a Select.. define - no problem.

           <div class="class_1" style="width:512px">
               <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0"
                   DataSourceID="SqlDataSource1" GridLines="None">
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="DokId"
                       DataSourceID="SqlDataSource1">
    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
     
    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
    <HeaderStyle Width="20px"></HeaderStyle>
    </RowIndicatorColumn>
     
    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
    <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>
     
        <Columns>
            <telerik:GridTemplateColumn DataField="DokuType"
                FilterControlAltText="Filter column column" HeaderText="Materials"
                UniqueName="DokuType">
                <EditItemTemplate>
                    <telerik:RadComboBox runat="server">
                    </telerik:RadComboBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <telerik:RadComboBox ID="RadComboBox1" Runat="server">
                        <Items>
                            <telerik:RadComboBoxItem runat="server" Text="Documentation"
                                Value="Tagungsunterlagen" />
                            <telerik:RadComboBoxItem runat="server" Text="Books" Value="Bücher" />
                            <telerik:RadComboBoxItem runat="server" Text="Other" Value="Sonstiges" />
                        </Items>
                    </telerik:RadComboBox>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="VAday"
                FilterControlAltText="Filter column1 column" HeaderText="Days"
                UniqueName="VAday">
                <EditItemTemplate>
                    <telerik:RadComboBox runat="server">
                    </telerik:RadComboBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <telerik:RadComboBox ID="RadComboBox2" Runat="server"
                        DataSourceID="SqlDataSource3" SelectedValue='<%# Bind("VAday") %>'>
                    </telerik:RadComboBox>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn FilterControlAltText="Filter Delegates column"
                HeaderText="Delegates" UniqueName="Delegates">
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="Menge" DataType="System.Int16"
                FilterControlAltText="Filter Menge column" HeaderText="Additional Amount"
                UniqueName="Menge">
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="Price"
                FilterControlAltText="Filter DokuType column" HeaderText="Unit Price"
                UniqueName="Price">
                <EditItemTemplate>
                    <asp:TextBox ID="DokuTypeTextBox" runat="server" Text='<%# Bind("DokuType") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="DokuTypeLabel" runat="server" Text='<%# Eval("DokuType") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
     
    <EditFormSettings>
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
    </EditFormSettings>
    </MasterTableView>
     
    <FilterMenu EnableImageSprites="False"></FilterMenu>
     
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
               </telerik:RadGrid>
               <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                   ConnectionString="<%$ ConnectionStrings:webzeus %>"
                   SelectCommand="SELECT * FROM [Dokus] WHERE ([Number] = @Number)">
                   <SelectParameters>
                       <asp:SessionParameter  Name="Number" SessionField="curNumber"
                           Type="Int32" />
                   </SelectParameters>
               </asp:SqlDataSource>
               <asp:SqlDataSource ID="SqlDataSource3" runat="server"
                   ConnectionString="<%$ ConnectionStrings:webzeus %>"
                   SelectCommand="pr_TNproTag" SelectCommandType="StoredProcedure">
                   <SelectParameters>
                       <asp:SessionParameter DefaultValue="12814" Name="curNumber"
                           SessionField="curNumber" Type="Int32" />
                       <asp:Parameter DefaultValue="Dokus" Name="curPar" Type="String" />
                   </SelectParameters>
               </asp:SqlDataSource>
           </div>
     
    </div>



  2. Cat Cheshire
    Cat Cheshire avatar
    128 posts
    Member since:
    Jun 2010

    Posted 27 May 2011 Link to this post

    It seems that a control called "cbDays" raises the exception.
    However there is no such combo in your markup...
    Maybe this combo is defined somewhere in your code-behind?
Back to Top