The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am trying to filter records in a gridgroupingcontrol based on the values in 3 columns. It seems like it should be an easy thing to do but I cannot seem to get correct results.
My grid has a "service code" column with a code for a service type like "0", "1", "2", "A", "B", "C" etc., an "authorised" column that has a string value of either "0" or "1" and a "preferred" column that has a string of either "0" or "1" as well. The user is supposed to be able to select any combination of "service code", "authorised" and "preferred" values and the grid should display only the records that match the selected values.
For example, if I want to show only records where (("service code" = "1") and ("authorised" = "0") and ("preferred" = "1" or "preferred" = "0")) then a simplified version of my code looks like this:
RecordFilterDescriptor rfd1 = new RecordFilterDescriptor(servicesFilterString); ggc.TableDescriptor.RecordFilters.Add(rfd1);
RecordFilterDescriptor rfd2 = new RecordFilterDescriptor(authorisedFilterString); ggc.TableDescriptor.RecordFilters.Add(rfd2);
RecordFilterDescriptor rfd3 = new RecordFilterDescriptor(preferredFilterString); ggc.TableDescriptor.RecordFilters.Add(rfd3);
ggc.EndUpdate(true); ggc.Refresh(); }
For some reason this approach doesn't seem to be working. For example, if I construct the "preferred" filter string as "([PREFERRED] = '1' OR [PREFERRED] = '0')" then the filter works as expected; however, if I construct it in the reverse order "([PREFERRED] = '0' OR [PREFERRED] = '1')" it doesn't filter the grid correctly (for example, all rows are filtered out of the grid when all rows should be displayed). Similarly, the order that of the conditions in the "services" filter string seems to affect whether the grid is filtered correctly and for certain seemingly random values all records in the grid are filtered out inexplicably. I can't see any reason why the order of the conditions should have any effect on the results.
Any help with this problem will be much appreciated!