void CBCGPGridCtrl::EnableFilterBar | ( | BOOL | bEnable, |
LPCTSTR | lpszPrompt, | ||
BOOL | bCaseSensitive = FALSE , |
||
const CList< int, int > * | pListOfColumnIndexes = NULL , |
||
BOOL | bUpdate = TRUE , |
||
COLORREF | clrMarkBackground = CLR_NONE , |
||
COLORREF | clrMarkText = CLR_NONE , |
||
const CBCGPEditColors & | colors = CBCGPEditColors() , |
||
BOOL | bIncludeGroups = FALSE , |
||
BOOL | bAutoExpandGroups = FALSE |
||
) |
Enables or disables "filter bar" mode.
Call this method to enable or disable the "filter bar" mode. In this mode the grid control displays an edit control under headers of specified columns. The grid data is filtered as the user types in the edit. The cumulative filter is applied to the whole grid data.
If you don't specify the list of column indexes (pListOfColumnIndexes is NULL), the filter will be enabled for all columns in the grid. If you wish to enable filter boxes under specific columns, you need to create a CList <int, int> object and fill it with zero-based indexes of columns to display filter boxes. Also you can call the EnableColumnFilterEdit() method to display or hide filter boxes for specific columns individually.
If you wish to customize the filter box edit control, override OnCreateFilterBarCtrl() and return a pointer to your custom control. The custom control must call OnFilterBarChanged() in order to notify that the filter for specified column has changed.
bEnable | Specifies whether the "filter bar" mode should be enabled or disabled. |
lpszPrompt | Specifies a text string to be displayed as a prompt in empty filter edit boxes. |
bCaseSensitive | Tells whether the filter is case sensitive or not. |
pListOfColumnIndexes | Contains a list of indexes of columns to display filter boxes. If this parameter is NULL, filter boxes will be displayed under all column headers. |
bUpdate | Specifies whether update the filter bar content. |
clrMarkBackground | Specifies highlighted (marked) text background color. |
clrMarkText | Specifies highlighted (marked) text foreground color. |
colors | Specifies filter bar edit control colors. |
bIncludeGroups | Specifies whether groups (items with sub-items) should be included in the filtering results. |
bAutoExpandGroups | Specifies whether groups (items with sub-items) will be automatically expanded when sub-item is included in the filtering results. |