How to set Grid filters in code


(Pierre Hogue) #1

Hello again,

When I right click on a Grid, I can select GridFilters “On”. Saving Layouts (right click on the grid, then from the top menu as well… ) I would have thought it would stay so next time I launch the form, this setting would stay.
But it does not.
How do I go about to set this within code?
Better yet, how about do I set it for one particuliar column?

Thanks

Pierre


(Brandon Anderson) #2

This thread will show you how to put it in code. It basically sets the grid filter like the user doing it on their own.The example is using a text box.


(Pierre Hogue) #3

Thanks Brandon! Exactly what I was looking for… :wink:

using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;

then under initializeCode:
MyGrid.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.True;

did the job!

Thanks.

Pierre