I’m a litte bit confused concerning checkboxes in the Telerik GridView. For this a made an example program to show the confusing point. It has to do with checkboxes, states and filtering.
I’ve a grid with a twoState checkbox and one with a threeState checkbox. The threeState one is doubled, one based on the nullable boolean and one with a typeconverter.
My goal is when I’ve a twostate checkbox column, to also have a twostate filter. When I let the code default, I get a threestate checkbox in the filter area. The third state is a filled box (Indeterminate). In my opinion it has no value because the filtering is treated like ‘I don’t care what the content is’ or simply ‘no filtering’. Ok.. I could live with that. The meaning of the Indeterminate status is the same as no filtering.
Now the first threestate one (bool?). when I start the application there is no checkbox in the filter area and it says ‘no filter’. If I want to filter I’ve to click explicitly on the filtericon, then the checkbox appears and I can click on it. The third state (Indeterminate) is like the first column. I see all the records. What I see as a problem is that I can’t filter on records who has Indeterminate (or null) as value. Thereby the meaning of the Indeterminate is not clear anymore. The filtering is treated like ‘no filter’ but in the records it means ‘there is no value’. Also I can’t get control on the appearance of the filterbox. Try playing with it by clicking on the checkbox and clicking ‘no filter’ in the contextMenu. Sometimes the filter checkbox disappears or its not clickable anymore. ??
The third checkbox column is one with a typeConverter behind it. At start of the application there is a checkbox in the filterarea and its stated as Indeterminate. I see all the records so it’s meaning should be the same as the first column – ‘no filtering’. Now when I start clicking on the filtercheckbox the meaning changes. Now it filters on Indeterminate. When I remove the filter through the contextMenu, the filterbox disappears. This is actually correct but it’s start state is not.
So, I’m pretty confused now.
Of course I’ve searched around on the internet and I found something interesting. In one the items on the Telerik forum I saw a possibility for breaking in on the filter checkbox appearance – it’s the ViewCellFormatting event. It looks like that when I’ve a twostate column, the filtercheckbox gets threestate and visaversa. Is this a bug??
In my example application I changed that (see code). A twoState column gets also a two state filtercheckbox by setting it explicitly. So please enable the eventhandler and run the program again.
Now I almost get what I would expect. The first column which is twostate, can only be filtered on 2 states. True or false. If one want to see all, remove the filter. Sounds logically.
The first threestate column (bool?) has no checkbox at start of the application. When I set filtering through the contextMenu, it appears and the meaning of Indeterminate is like ‘no filter’. If I remove the filter, the checkbox does not and the state is Indeterminate. ??
The second threestate (with a converter) reacts the same as without the eventhandler. It starts with a checkbox in the filter area which has the Indeterminate state, but I see all the records. After clicking it, it starts to filter it correctly. At removing the filter, the filterbox is empty.
As you can probably understand the current situation is not acceptable for us because of ambiguous meanings and inconsistency concerning the start situation and after working in the grid.
What’s going on?? What is the intention of Telerik and where do I get confused??
What I would like to have is in case of a two state column, a two state filtercheckbox and the working of the column with the converter except not with that starting state. At start the filterbox should be empty.
Please help me out of this.