RadComboBox + ItemRequested + Script control xxx is not a registered script control Issue

2 posts, 0 answers
  1. AnwarBasha
    AnwarBasha  avatar
    1 posts
    Member since:
    Oct 2010

    Posted 16 Feb 2011 Link to this post

    Hi All,
           

    I am creating a custom control(.dll) which has RadTextBox, Rad combo box having gird(_grd2) as its Item and a Image button which opens radwindow having another grid(_grd1).

    My requirement is that onKeypress i.e., based on character entered in combobox text, content of grid(_grd2)  (which is available as item in combobox) need to be filtered and displayed .

    To achieve this i am using Item requested event where i am setting grid’s(_grd2)filter expression but getting following error popup immediately after ItemsRequested event procedure.

     “Script control xxx(i.e.,_grd2) is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors()

    Parameter name: scriptControl”

    Please suggest  me way to resolving this issue.

    As a note that

    1)       using script manager in aspx where custom control is consumed.

    2)      I approached following ways but none of them worked
    I tried using RadScriptManger instead of aspx scriptamanager but still I got same error.

    Same error is poping up even on use of OnClientItemRequesting and OnClientItemRequested events.

    When I made _grd2.RegisterWithScriptManager = false;  and combobox.RegisterWithScriptManager = false then ItemRequested event is fired and grid got filtered with filter expression applied but none of filtered rows are selectable i.e., postback is not happening during row click of radgrid(_grd2) , infact row click is not happening and item command is not fired.

    RadAjaxManagerProxy _ramMangagerProxy = new RadAjaxManagerProxy();
    _ramMangagerProxy.ID = "RadAjaxManager";
    _ramMangagerProxy.ClientIDMode = ClientIDMode.AutoID;
     
    RadAjaxLoadingPanel _ralLoadingPanel = new RadAjaxLoadingPanel();
    _ralLoadingPanel.ID = "RadAjaxLoadPanel";
    _ralLoadingPanel.ClientIDMode = ClientIDMode.AutoID;
     
    AjaxSetting _settings = new AjaxSetting();
    _settings.AjaxControlID = _grd1.ID;
     
    AjaxUpdatedControl _id = new AjaxUpdatedControl();
    _id.ControlID = _grd1.ID;
    _id.LoadingPanelID = _ralLoadingPanel.ID;
     
    _settings.UpdatedControls.Add(_id);
    _ramMangagerProxy.AjaxSettings.Add(_settings);
     
    RadGrid _grd2 = new RadGrid();
    _grd2.ID = “Grd2”;
    _grd2.ClientIDMode = ClientIDMode.AutoID;
    _grd2.NeedDataSource += new GridNeedDataSourceEventHandler(Grd2_NeedDataSource);
    _grd2.ClientSettings.Selecting.AllowRowSelect = true;
    _grd2.EnableLinqExpressions = false;
    _grd2.RegisterWithScriptManager = true;
    _grd2.ItemCommand += new GridCommandEventHandler(Grd2_GridItemCommand);
     
    RadComboBox  _drdComboBox = new RadComboBox();
    _drdComboBox.ID =“ DrdComboBox”;
    _drdComboBox.CssClass = DrdComboBoxCss;
    _drdComboBox.AllowCustomText = true;
    _drdComboBox.AutoPostBack = false;
    _drdComboBox.MarkFirstMatch = true;
    _drdComboBox.EnableLoadOnDemand = true;
    _drdComboBox.ClientIDMode = ClientIDMode.AutoID;
    _drdComboBox.ItemsRequested += new RadComboBoxItemsRequestedEventHandler(_drdComboBox_ItemsRequested);
     
    RadComboBoxItem item = new RadComboBoxItem();
    item.Controls.Add(_grd2);
    _drdComboBox.Items.Add(item);
     
    protected void Grd2_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
     
    _grd2. DataSource = dataTable (or) dataset (or) list;
     
    }
     
    protected void Grd2_GridItemCommand(object sender, GridCommandEventArgs e)
    {
     
    // code regarding row click.
     
    }
     
    protected void _drdComboBox_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
    {
    if (e.Text != "")
    {
    this._grd2.MasterTableView.FilterExpression = "([Col] LIKE 'txt %')";
    _grd2.MasterTableView.Rebind();
    }
    }

    Can you please help me in finding best solution for this issue.
Back to Top