Problem with filtring data

Page 3 of 4 FirstFirst 1234 LastLast
  1. #21
    As you can see gridfilters are passed by the store but you return incorrect data (you set filter value "tomate" but return data items without that word)
    Check how you filtering your data
  2. #22
    Hi,

    As I mentioned you have to filter data in your web service method (ideally, to pass filters conditions to sql stored procedure or sql query)
  3. #23
    the data was displayed before applying filter, they don't change , and to filter data i'm using your example code
  4. #24
    Remote filtering assumes new data request with filters conditions, you have to bind new filetered data
    In our online sample we bind data in the page (PageProxy using)
    You bind data in the web service therefore remote filtering must be performed in the webservice method
  5. #25
    Hi,
    i am always blocked i can't find any solution about this problem , and i need this to work properly this is the most important action in my application, i have to found a solution and i don't have any idea how to proceed, please if you have any suggestion which can deblocked me i'll be grateful.
  6. #26
    Hi,

    I cannot help you because you don't provide enough information, what exactly troubles do you have? Do you handle passed filters in the web service method?
  7. #27
    The problem I have is that the filtered data do not appear, while the post is done correctly, i joined to my post the web service if you can throw a look please
    Attached Files
  8. #28
    Hi,

    I don't see that you use filters in your web service, you return a data without any filtering
  9. #29
    there is an error on the Attached Files, the event page_load is in comment normally
  10. #30
    this is the part which normally must filter the data
     protected void Store1_RefreshData(object sender, StoreRefreshDataEventArgs e)
            {
                List<MyDvpt> list1 = new List<MyDvpt>();
    
                string s = e.Parameters["gridfilters"];
    
                //-- start filtering ------------------------------------------------------------
                if (!string.IsNullOrEmpty(s))
                {
                    FilterConditions fc = new FilterConditions(s);
    
                    foreach (FilterCondition condition in fc.Conditions)
                    {
                        Comparison comparison = condition.Comparison;
                        string field = condition.Name;
                        FilterType type = condition.FilterType;
    
                        object value;
                        switch (condition.FilterType)
                        {
                            case FilterType.Boolean:
                                value = condition.ValueAsBoolean;
                                break;
                            case FilterType.Date:
                                value = condition.ValueAsDate;
                                break;
                            case FilterType.List:
                                value = condition.ValuesList;
                                break;
                            case FilterType.Numeric:
                                if (list1.Count > 0 && list1[0].GetType().GetProperty(field).PropertyType == typeof(int))
                                {
                                    value = condition.ValueAsInt;
                                }
                                else
                                {
                                    value = condition.ValueAsDouble;
                                }
    
                                break;
                            case FilterType.String:
                                value = condition.Value;
                                break;
                            default:
                                throw new ArgumentOutOfRangeException();
                        }
    
                        list1.RemoveAll(
                            item =>
                            {
                                object oValue = item.GetType().GetProperty(field).GetValue(item, null);
                                IComparable cItem = oValue as IComparable;
    
                                switch (comparison)
                                {
                                    case Comparison.Eq:
    
                                        switch (type)
                                        {
                                            case FilterType.List:
                                                return !(value as ReadOnlyCollection<string>).Contains(oValue.ToString());
                                            case FilterType.String:
                                                return !oValue.ToString().StartsWith(value.ToString());
                                            default:
                                                return !cItem.Equals(value);
                                        }
    
                                    case Comparison.Gt:
                                        return cItem.CompareTo(value) < 1;
                                    case Comparison.Lt:
                                        return cItem.CompareTo(value) > -1;
                                    default:
                                        throw new ArgumentOutOfRangeException();
                                }
                            }
                        );
                    }
                }
            }
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. problem with filtring data from grid
    By oseqat in forum 1.x Help
    Replies: 1
    Last Post: Jul 30, 2011, 3:52 PM
  2. [CLOSED] filtring grid Panel in menu
    By imaa in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 26, 2011, 11:24 AM
  3. [1.0] data paging problem
    By pbsoft in forum 1.x Help
    Replies: 1
    Last Post: Nov 02, 2010, 10:21 AM
  4. Problem with no data in store
    By Elenka in forum 1.x Help
    Replies: 2
    Last Post: Oct 19, 2010, 11:39 AM
  5. export data problem
    By maxdiable in forum 1.x Help
    Replies: 0
    Last Post: Feb 28, 2010, 10:32 AM

Tags for this Thread

Posting Permissions