Dynamic RadFilter

2 posts, 0 answers
  1. Angad
    Angad avatar
    1 posts
    Member since:
    Sep 2015

    Posted 16 Sep 2015 Link to this post

    I am initializing the RadFIlter component from Server side.  After initializing, I am loading the collection list into the component. In the front end, whenever I am clicking on the item of the list, it works fine. There is a refresh interval timeout (5 seconds). After every 5 seconds, I am loading the values from the database on the front end grid.
    So whenever I click on any Radfilter items after 5 seconds refresh interval, the error window appears which says "index was out of range. must be nonnegative and less than the size of the collection List". Within the 5 seconds interval, it works fine. It seems the values which I am loading on the server side are getting lost. 
    I am performing the following steps;
    1. On the page initialization, I am creating the Rad FIlter Component.
     this.ComplexFilter = new RadFilter()
                            ID = "ComplexFilter",
                               AllowFilterOnBlur = true,
                              ShowApplyButton = false,
                              Skin = "Vista",
                              EnableViewState = false
    this.ComplexFilter.ItemCommand += this.ComplexFilter_OnItemCommand;
    fieldEditor.FieldName = column.JsName; // column is the list of items. This I am doing for every column list item.
    fieldEditor.DisplayName = column.Name;
     fieldEditor.DataType = column.Type;
    var rootGroup = this.Settings.ComplexFilter_Expression;
     if (rootGroup != null)
                        this.ComplexFilter.RootGroup.GroupOperation = rootGroup.GroupOperation;
                         foreach (var expression in rootGroup.Expressions)
                    this.ComplexFilter.PreRender += this.ComplexFilter_OnPreRender;
    void ComplexFilter_OnUpdate(object sender, EventArgs args)
                string previousComplexFilterSql;
                 string newComplexFilterSql; 
                if (this.Settings.ComplexFilter_Sql != null)
                    previousComplexFilterSql = this.Settings.ComplexFilter_Sql;
                    if (this.Settings.ComplexFilter_Expression != null)
                        previousComplexFilterSql = this.Settings.ComplexFilter_Expression.ToWhere(this.TablesTable).ToString();
                        previousComplexFilterSql = String.Empty;
                if (this.Settings.ComplexFilter_Visible)
                    this.Settings.ComplexFilter_Expression = this.ComplexFilter.RootGroup;
                    newComplexFilterSql = this.Settings.ComplexFilter_Sql = this.Settings.ComplexFilter_Expression.ToWhere(this.TablesTable).ToString();
                    newComplexFilterSql = String.Empty;
                this.ComplexFilter_ReloadData(previousComplexFilterSql, newComplexFilterSql); 
      2. After every 5 seconds Refresh timeout, I am checking for the complex filter saved settings. But due to the null value of ComplexFilter_Expression, settings could not be fetched from the database.
       if (this.ComplexFilter_Visible && this.ComplexFilter_Expression != null)
                    where &= this.ComplexFilter_Expression.GetDBWhere(table, joins, out saveSettings); 
                    saveSettings = false;

    I request to the Telerik expertise, to tell me what I am doing wrong. Why the Telerik object is getting lost due the front end refresh time interval.
  2. Angel Petrov
    Angel Petrov avatar
    1016 posts

    Posted 22 Sep 2015 Link to this post


    The information provided is not sufficient for us to determine the root cause of the issue. Moreover since the control is initially created it seems that all should be working fine.

    In order for us to provide a precise answer regarding this matter I would recommend isolating the issue in a separate sample which we can debug. Information on how to achieve this is provided here.

    Angel Petrov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top