FILTER PROBLEM

14 posts, 0 answers
  1. JOSE MANUEL PÉREZ RAMÍREZ
    JOSE MANUEL PÉREZ RAMÍREZ avatar
    22 posts
    Member since:
    Jan 2008

    Posted 21 Apr 2008 Link to this post

    i can not set filter (Contains, start with...) in radgrid.

    i think radcontrols avanced tutorial is necesary to consolidate this product.
  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 21 Apr 2008 Link to this post

    Hello Jose,

    Thank you for contacting us.

    Please provide us with additional details on the particular use case. What is the type of column that you're setting the filter to? Is this in bound or unbound mode?

    Please keep in mind that the "Contains" & "Starts with" functions are only applicable on text columns.

    All the best,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. JOSE MANUEL PÉREZ RAMÍREZ
    JOSE MANUEL PÉREZ RAMÍREZ avatar
    22 posts
    Member since:
    Jan 2008

    Posted 22 Apr 2008 Link to this post

    this code can not run in 2008 Q1. I need to set filter.

    (2007 Q3 code)
    gridViewTextBoxColumn2.Filter.Function = Telerik.WinControls.UI.

    GridKnownFunction.StartsWith;

    how in 2008?

  5. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 22 Apr 2008 Link to this post

    Hi JOSE,

    The filtering functionality of RadGridView has been extended to allow application of multiple conditions on a single field (column).


    Here is a code snippet that changes the user's filter function:

    FilterExpression filter = new FilterExpression(FilterExpression.BinaryOperation.AND, GridKnownFunction.StartsWith, GridFilterCellElement.ParameterName); 
     
    this.radGridView1.Columns["City"].Filter = filter; 

    If you need further assistance, do not hesitate to write us back.

    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. JOSE MANUEL PÉREZ RAMÍREZ
    JOSE MANUEL PÉREZ RAMÍREZ avatar
    22 posts
    Member since:
    Jan 2008

    Posted 22 Apr 2008 Link to this post

    Is possible to set in gridview designer. (Vs2005)...  same 2007 Q3??
  7. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 22 Apr 2008 Link to this post

    Hello Jose,

    Yes, you can use the designer to set the filter as well. Just add a predicate (if there is none) and set the predicate's filter function to the required one.

    It is important to set the predicate's  parameter to "@FilterEditor1". This way you'll indicate that the predicate will use the user's input (the textbox below the column's header).

    Contact me again with any other questions you have.

    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. JOSE MANUEL PÉREZ RAMÍREZ
    JOSE MANUEL PÉREZ RAMÍREZ avatar
    22 posts
    Member since:
    Jan 2008

    Posted 08 May 2008 Link to this post

    i don't know reproduce about your reply. Can you explain it?
  9. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 09 May 2008 Link to this post

    Hello JOSE MANUEL PÉREZ RAMÍREZ,

    Let me clarify. Setting a filter expression to a column in design time is quite easy. If you use the filter editor, all the parameters will be set for you.

    In order to set a filter to a column at design time, you have to just follow the steps below:
    1. Open the form in design time
    2. Select a RadGridView control
    3. Locate in the property grid the MasterGridViewTemplate property and expand it
    4. In the expanded properties under the MasterGridViewTemplate in the property grid, locate the Columns collection and open the collection editor for it
    5. Locate the desired column in the collection editor
    6. In the property grid on the left, locate the Filter property for the selected column and open the filter editor for it
    7. Set the desired filter expression
    I hope this helps.

    Best wishes,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. JOSE MANUEL PÉREZ RAMÍREZ
    JOSE MANUEL PÉREZ RAMÍREZ avatar
    22 posts
    Member since:
    Jan 2008

    Posted 12 May 2008 Link to this post

    Sorry i don't explain correctly.
    In example, I want to set filter to "contains" for usability and don't specify the predicate (user set it). in this case the filter don't save it.
    In Q3 2007 i can set it without predicate, and the filter pre-set in contains, start of, ... .

    very thanks
  11. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 12 May 2008 Link to this post

    Hi JOSE MANUEL PÉREZ RAMÍREZ,

    In Q1 2008, the Contains filter function is default for the string type, so you do not have to set it. Also, in 2008 Q1 Service Pack 1, that is due in the middle of this month, you will be able to change the filter function without setting the parameter.

    Greetings,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  12. Faisal
    Faisal avatar
    3 posts
    Member since:
    Oct 2008

    Posted 18 Nov 2008 Link to this post

    Jordan mentioned that:
    "In Q1 2008, the Contains filter function is default for the string type, so you do not have to set it"

    I am having trouble with filters on decimal fields. When I set them using the property build to Equals, they work fine once. But then they get reset to 'No Filter' automatically when I rebuild my solution after making other unrelated changes to the grid. Is this a bug in RadGridView? Is there a way to force them to stay intact. I have a lot of columns and everytime I make any changes, the filter revert back to No Filter on the decimal fields.

    How can I force set them in my C# code?

    Thanks,
    Faisal
  13. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 20 Nov 2008 Link to this post

    Hi Faisal,

    Which release of RadControls for WinForms are you using? In the last release (Q3 2008) quite a lot of fixes were made to the RadGridView property builder. Also the "Equal To" filter function is now default for the decimal and DateTime types.

    And to be sure that your filter settings are not overridden by the designer you could set them yourself as in the Filtering example for RadGridView.
     

    Best wishes,
    Jordan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  14. Faisal
    Faisal avatar
    3 posts
    Member since:
    Oct 2008

    Posted 20 Nov 2008 Link to this post

    Thanks.

    I am using Q2 2008 SP1. The filters I am referring to are the ones that appear right below the header row for each column. The default for the the decimal field is 'No Filter' and even when I set it in the property builder, it reverts back to 'No Filter'. The default for integer types seems to be 'Equals' which is what you are referring to; however, I have doubles in there as well where filter default of 'Equals' does not seem to work.

    The example that I found in the online documentation is at http://www.telerik.com/help/winforms/grid_setting-filters-programmatically.html. However, this does not seem to override the 'No Filter' action either.

    Is this issue fixed in Q3 2008?

    Thanks,
    Faisal
  15. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 21 Nov 2008 Link to this post

    Hi Faisal,

    That code from the documentation:

    filter.Predicates.Add(FilterExpression.BinaryOperation.AND,
       GridKnownFunction.StartsWith,
       GridFilterCellElement.ParameterName);

    should change the filter function to "Starts With" (for a string column). If you are still experiencing problems, then you have hit a bug that was fixed in the Q3 2008 release. In this case I would suggest using Q3 2008.

     
    All the best,
    Jordan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready