error when type in RadComboBox

2 posts, 0 answers
  1. samaneh
    samaneh avatar
    17 posts
    Member since:
    Jan 2011

    Posted 26 Apr 2011 Link to this post

    Hi all

    I use a RadComboBox which contans a RadGrid in itemTemplate,when user type a word in ComboBox, this error raised:
     "Script control 'gv_supplier' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors(). Parameter name: scriptControl".

    how can I fix it?

    <telerik:RadComboBox ID="RadComboBox1" runat="server" DropDownWidth="300px" EmptyMessage="select..."
                EnableLoadOnDemand="True" HighlightTemplatedItems="True" ItemRequestTimeout="10" >
                <Items>
                    <telerik:radcomboboxitem selected="true" />
                </Items>
                <ItemTemplate>
                    <telerik:RadGrid ID="gv_supplier" runat="server" GridLines="None" Skin="Vista" Width="100%"
                        AllowSorting="True" AutoGenerateColumns="False" ShowFooter="True">
                        <AlternatingItemStyle BackColor="#a7bcdb" />
                        <MasterTableView AllowSorting="True" DataKeyNames="supplier_kind_id" Dir="RTL" Font-Names="Tahoma"
                            HeaderStyle-HorizontalAlign="Center" HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                             ClientDataKeyNames="supplier_kind_id,supplier_kind_code" >
                            <CommandItemSettings ShowAddNewRecordButton="false" />
                            <Columns>
                                <telerik:GridTemplateColumn UniqueName="col_row_number" HeaderText="row">
                                    <ItemTemplate>
                                        <asp:Label ID="numberLabel" runat="server" Width="30px" />
                                    </ItemTemplate>
                                    <HeaderStyle Width="30px" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="supplier_kind_id" UniqueName="supplier_kind_id"
                                    Visible="false">
                                    <ItemTemplate>
                                        <asp:Label ID="lbl_supplier_kind_id" runat="server" Text='<%# Bind("supplier_kind_id") %>' />
                                    </ItemTemplate>
                                    <HeaderStyle Width="50px" />
                                    <ItemStyle Width="50px" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="supplier_kind_code" EmptyDataText="----" HeaderText="code"
                                    ReadOnly="True" Resizable="true" UniqueName="supplier_kind_code">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="supplier_kind_name" EmptyDataText="----" HeaderText="name"
                                    Resizable="true" UniqueName="supplier_kind_name">
                                </telerik:GridBoundColumn>
                            </Columns>
                            <NoRecordsTemplate>
                                nothing to displaye.
                            </NoRecordsTemplate>
                            <RowIndicatorColumn>
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </RowIndicatorColumn>
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                            <Resizing AllowColumnResize="True" ResizeGridOnColumnResize="false" />
                            <Selecting AllowRowSelect="True" />
                            <ClientEvents OnRowSelected="onRowSelected" />
                        </ClientSettings>
                    </telerik:RadGrid>
                </ItemTemplate>
                <FooterTemplate>
                  
                </FooterTemplate>
            </telerik:RadComboBox>

    <telerik:radcodeblock id="codeBlock" runat="server">   
        <script type="text/javascript">   
        
           function onRowSelected(sender, args)    
            {   
                var selectedText = args.getDataKeyValue("supplier_kind_code");   
                var selectedValue = args.getDataKeyValue("supplier_kind_id");
      
                var combo = $find("RadComboBox1");
      
                setTimeout(
                            function() 
                            {
                                combo.set_text(selectedText);
                                combo.set_value(selectedValue);
                            }
                           , 50);
      
            }
      
                 
        </script>  
    </telerik:radcodeblock>
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Apr 2011 Link to this post

    Hello Samaneh,

    I tried to the same and that worked fine at my end.

    Here I have found a forum which discussed similar scenario. take look at this.
    RADGRID inside a RADCOMBOBOX

    Hole it helps.
    Thanks,
    Shinu.
Back to Top