in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Filter Control - Load Previous Filter

Last post 6/6/2007 10:26 AM by Nicholas Passero. 4 replies.
Page 1 of 1 (5 items)
Sort Posts:
Previous Next
  • 6/5/2007 12:45 PM

    Filter Control - Load Previous Filter

    Say you have a nice long filter:

    [Employee_ID] Between(100, 150) Or [Employee_ID] Between(200, 250) Or [Employee_ID] Between(300, 350) Or [Employee_ID] Between(400, 450) 

    And you want to add to it after you have already generated a report and closed the program.. Is there a way to  load this filter into the filter control and have it show up as it would if I had just selected the same filters over again ?
    If you need it explained more let me know.. 

    Filed under:
  • 6/6/2007 2:41 AM In reply to

    Re: Filter Control - Load Previous Filter

    Hello Nicholas,

    This is quite easy - just retrieve the filter instruction from the FilterControl's FilterString property, save it somewhere and later restore it to FilterString property.

    Please have a look to the attached sample project.


    Hope this helps,
    Holger

    BTW, I noticed you are located in Verona - very nice city. I had been there for several times.

    Holger Persch - [DX-Squad]
  • 6/6/2007 9:13 AM In reply to

    Re: Filter Control - Load Previous Filter

    Not sure why I didn't try that before. Makes perfect sense.
    - Now the only problem is say you develop the filter string, and in the string you make a change to it ( as text format ) to a valid SQL Statement.. ex [Employee_ID] = sqrt(64)  ... This will give a syntax error, is there any way that it can read it as the SQL statement and put it back into the filter string ?
  • 6/6/2007 9:35 AM In reply to

    Re: Filter Control - Load Previous Filter

    Hello,

    As far as I know it's not possible - you will have to convert the filter string, respectively remove all incompatible instructions, before applying it to the FilterControl.

    Regards,
    Holger
    Holger Persch - [DX-Squad]
  • 6/6/2007 10:26 AM In reply to

    Re: Filter Control - Load Previous Filter

    The only way I found possible is to pass it in quotes as 'sqrt(64)' and then when you have to re-write it to sql is to remove the quotes.. Probably too difficult to parse. - There would be too many quotes that would be removed, and you wouldn't be able to tell which quotes are surrounding what..
     

Page 1 of 1 (5 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED