This is a migrated thread and some comments may be shown as answers.

[Solved] Multi-column filtering in with EnableColumnsViewState set to false

2 Answers 126 Views
Grid
This is a migrated thread and some comments may be shown as answers.
QualiWareUA
Top achievements
Rank 1
QualiWareUA asked on 05 May 2008, 02:30 PM
Hello,

I have a grid that has AllowFilteringByColumn  set to true. At the same time EnableColumnsViewState is set to false (grid is created dynamically). As a result multi-column filtering does not work. How can I work around this issue?

2 Answers, 1 is accepted

Sort by
0
QualiWareUA
Top achievements
Rank 1
answered on 05 May 2008, 03:11 PM
The problem seems to be in setting EnableColumnsViewState to false. From other side it cannot be set to true, because the grid is created dynamically.

It seems to be strange, but creating grid in code behind (not defining it in .aspx and creating its structure in code-behind) seems to work correctly with multi-column filtering and sorting. I do not get the difference between two approaches, because the settings are the same... Any help will be very much appreciated.

PS I do not tend to define the whole grid in code-behind, because I use command items and there should be written very much code to define these command items from code-behind.
0
Konstantin Petkov
Telerik team
answered on 06 May 2008, 09:28 AM
Hi Vladimir,

I believe the answer is in the document:

For the controls inside a template to persist their ViewState, the grid must be generated completely in the code-behind using the Page_Init event (see below). That way, template controls are instantiated before the LoadViewState event of the page.

You also won't need to set the EnableColumnsViewState to false when building the Grid entirely in the code behind.

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
QualiWareUA
Top achievements
Rank 1
Answers by
QualiWareUA
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Share this question
or