Another null-reference exception, deep in your code...

Once again, another null reference, deep in either Syncfusion or Microsoft code.

The point of a component library is to make it FASTER to write code. Lately, I keep hitting this kind of thing. I'll wait a couple of days, then get a response asking me to write a complete new application to demonstrate the problem... and so on...

I'm sorry, but I don't know if I should even bother to attempt to use these controls. Sometimes they are very nice. When. They. Work. 

Firing a null exception is not ever acceptable. It should not be possible for me to pass you a parameter that does this, let alone does this with no explanation.

A cascading drop down should be super-duper simple, and although there is a demo, there is no _explanation_ of the demo. There's no discussion what a "Query" is or what "filter operator" I can use. Where filter operator is explained in the help for "WhereFilter" there is no list of valid values. So, it takes several hours to find out how to use the control that was meant to same me time, and it's all by trial and error.

I am frustrated and annoyed. 

Please make your code more bulletproof for nulls, and explain what you are doing in your examples.






1 Reply 1 reply marked as answer

BC Berly Christopher Syncfusion Team April 6, 2021 07:02 AM UTC

Hi Byron, 

Greetings from Syncfusion support. 

We have added the description about the cascading functionality in the demo site itself. Also, we have documented the details about Query, Where Filter and filter operator and attached it below. 
The “where” query is used to filter some particular or related records from the data source to review details of records. 

 


Filter operators are generally used to specify the filter type. The various filter operators supported by DataManager is listed below. These filter operators are used for creating filter query using where method and Predicate class

  1. greaterthan
  2. greaterthanorequal
  3. lessthan
  4. lessthanorequal
  5. equal
  6. notequal
  7. startswith
  8. endswith
  9. contains
For your convenience, we have prepared the cascading sample with ComboBox component and attached it below. 

 
In the cascading sample, initially the Combobox component in disabled state. When we change the value in the first combobox, then ValueChange event will be fired. In this event handler, we have fetched the data based on the query where the data source in the items (“State”,” Countries”) are same with “CountryId” field name. The same action done for the second and third combobox component with field name “StateId”. 

public void ChangeCountry(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, Countries> args) 
    { // First combobox component change handler 
        this.EnableStateDropDown = !string.IsNullOrEmpty(args.Value); // Enable the second combobox component based on value selection 
        this.EnableCitytDropDown = false; // Disable the combobox component. 
        this.StateQuery = new Query().Where(new WhereFilter() { Field = "CountryId", Operator = "equal", value = args.Value, IgnoreCase = false, IgnoreAccent = false }); // Fetch the data which contryID is same from two ComboBox        this.StateValue = null; // To make the Second combobox value as null 
        this.CityValue = null; // To make the Third combobox value as null 
    } 
 
    public void ChangeState(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, State> args) 
    { // Second combobox component change handler 
        this.EnableCitytDropDown = !string.IsNullOrEmpty(args.Value);// Enable the thrid combobox component based on value selection 
        this.CityQuery = new Query().Where(new WhereFilter() { Field = "StateId", Operator = "equal", value = args.Value, IgnoreCase = false, IgnoreAccent = false });// Fetch the data which StateId is same from two ComboBox        this.StateValue = null; // To make the Second combobox value as null 
        this.CityValue = null; // To make the Third combobox value as null 
    } 
 
The reported issue is does not occurred at our end. So, please modify the attached sample with the reported issue else share any simple issue reproducing sample that will help us to check and proceed further at our end. 

Regards, 
Berly B.C 


Marked as answer
Loader.
Up arrow icon