Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to restore Auto Filter Row values from an active filter of the GridView after restoring the layout

$
0
0

If you are familiar with our ASPxGridView component, then you might have noticed that, by default, it fills the auto filter row from the filter after restoring the grid's state. Our GridControl component also has this feature, but it is currently undocumented and is disabled by default.

To automatically enable this functionality after restoring the grid's layout, set the static GuessAutoFilterRowValuesFromFilterAfterRestoreLayout property of the GridView object to True.

If you want to enable this feature at runtime on demand, call the GuessAutoFilterRowValuesFromFilter method of the GridView object.


IMPORTANT NOTES
1. Both approaches are currently undocumented, because not all standard scenarios are supported. So, carefully test your application when using the aforementioned APIs to see whether this feature meets your business needs before releasing your app. Don't hesitate to contact us in case of any issues.

2. To use these solutions in an XAF WinForms app, consider the following ViewController:

[C#]
usingSystem;usingDevExpress.XtraGrid;usingDevExpress.ExpressApp;usingDevExpress.XtraGrid.Views.Grid;usingDevExpress.ExpressApp.Win.Editors;namespaceMainDemo.Module.Win{publicclassB152594:ViewController<ListView>{GridListEditorgridlistEditor=null;protectedoverridevoidOnViewControlsCreated(){base.OnViewControlsCreated();gridlistEditor=View.EditorasGridListEditor;if(gridlistEditor!=null){gridlistEditor.Grid.HandleCreated+=Grid_HandleCreated;}}privatevoidGrid_HandleCreated(objectsender,EventArgsargs){GridControlgrid=(GridControl)sender;grid.HandleCreated-=Grid_HandleCreated;using(varcriteriaScope=View.ObjectSpace.CreateParseCriteriaScope()){((GridView)grid.MainView).GuessAutoFilterRowValuesFromFilter();}}}}


See Also:

Filtering via Code
Auto Filter Row

Question Comments

Added By: D. Samsonoff at: 1/30/2014 3:52:09 AM    

GuessAutoFilterRowValuesFromFilter() method does not work in 13.2.6.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>