Empty data is Ignored while sorting - Syncfusion.EJ2.Base.DataOperations

Hi,
I have performing the sorting operation using the grid data. While performing the sorting with data, it is working properly. If i am sorting with empty data, the empty values are ignored in the grid.

Please check the below example.
Before performing sorting with empty value
After performing sorting with empty value

Kindly give the accessing option for the empty data while sorting. Check and provide the solution.

Thanks,
Rajkumar S

1 Reply

RR Rajapandi Ravi Syncfusion Team March 17, 2021 12:05 PM UTC

Hi Rajkumar, 

Greetings from syncfusion support 

Based on your query we could see that you are maintaining an empty value in the Grid and facing the problem while sorting. In your query you have mentioned that while sorting the empty value column the values are ignored. We have prepared a sample which was same as your application scenario and try to reproduce your reported problem, but it was unsuccessful. Null values are not ignored while sorting. Please refer the below code example and sample for more information. 

HomeController.cs 

public static List<Orders> getAllRecords() 
            { 
                if (order.Count == 0) 
                { 
                    int code = 10000; 
                    for (int i = 1; i < 10; i++) 
                    { 
                        order.Add(new Orders(code + 1, null, i + 0, 2.3 * i, new DateTime(1991, 05, 15), "Berlin", "Denmark")); 
                        order.Add(new Orders(code + 2, "VINET", i + 2, 3.3 * i, new DateTime(1990, 04, 04), "Madrid", "Brazil")); 
                        order.Add(new Orders(code + 3, "ANTON", i + 1, 4.3 * i, new DateTime(1957, 11, 30), "Cholchester", "Germany")); 
                        order.Add(new Orders(code + 4, null, i + 3, 5.3 * i, new DateTime(1930, 10, 22), "Marseille", "Austria")); 
                        order.Add(new Orders(code + 5, "BOLID", i + 4, 6.3 * i, new DateTime(1953, 02, 18), "Tsawassen", "Switzerland")); 
                        code += 5; 
                    } 
                } 
                return order; 
            } 




If you still face the issue, please share the below details that will be helpful for us to provide better solution 

1)      Please share your complete grid rendering code and share your modal data. 

2)      Please share any issue reproducible sample or try to reproduce the issue with our above attached sample. 

3)      Please share the issue scenario in video demonstration format.  

Regards,
Rajapandi R


Loader.
Up arrow icon