Telerik
Home / Support / Knowledge Base / RadControls for ASP.NET and ASP.NET AJAX / Grid / Problem having null values when grouping in RadGrid

Problem having null values when grouping in RadGrid

Article Info

Rating: 3

Article information

Article relates to

RadGrid v.4.x

Created by

Nikolay Dobrev, Telerik

Last modified

 September 27, 2007

Last modified by

Stephen, Telerik


This article is applicable for RadGrid versions prior to 5.0.0. In RadGrid 5.0.0 grouping by columns which have null values should work out-of-the-box

PROBLEM
When grouping by a column that has null values, only the group header for those values appears and the items with null values are missing (they should be on the place of the red line in the image below).



SOLUTION

A possible workaround is to replace the null values in the SELECT statement. In this example we replace the null values with   :

SelectCommand="SELECT CustomerID, CompanyName, ContactTitle, Address, City,
 ISNULL(Region, ' ') AS Region,
 PostalCode, Country, Phone, Fax, ContactName FROM Customers"
 

As a result, the values are grouped correctly and the items are shown under the group header:


Comments

  • Rich Coleman , Jul 18, 2007

    This wouldn't work for a LastName + ', ' + FirstName AS FullName column because of the comma would keep it from being NULL - any other suggestions?

  • Telerik Admin , Jul 19, 2007

    Rich, start a formal support ticket and provide a working demo which demonstrates the issue. We will test it and will get back to you with our findings.

If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.

Powered by Sitefinity ASP.NET CMS

Contact Us | Site Feedback | Terms of Use | Privacy Policy
Copyright © 2002-2010 Telerik. All rights reserved.