When I add grouping to a radGrid in our application a NullRefrenceException is thrown in grid related code. The grid is using custom skins and css files and the exception isn't thrown when the custom skins aren't used. The skins are just adapted versions of the Office 2007 skin and work fine when grouping isn't used.
Thanks
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053



but fails
here is the sample code
class SiteDataItem
{
private string _text;
private string _url;
private int _id;
private int? _parentId;
public string Text
{
get { return _text; }
set { _text = value; }
}
public string Url
{
get { return _url; }
set { _url = value; }
}
public int ID
{
get { return _id; }
set { _id = value; }
}
public int? ParentID
{
get { return _parentId; }
set { _parentId = value; }
}
public SiteDataItem(int id, int? parentId, string text, string url)
{
_id = id;
_parentId = parentId;
_text = text;
_url = url;
}
}
protected void Page_Load(object sender, EventArgs e)
{
List
<SiteDataItem> siteData = new List<SiteDataItem>();
siteData.Add(
new SiteDataItem(1, null, "All Sites", ""));
siteData.Add(
new SiteDataItem(2, 1, "Search Engines", ""));
siteData.Add(
new SiteDataItem(3, 1, "News Sites", ""));
siteData.Add(
new SiteDataItem(4, 2, "Yahoo", "http://www.yahoo.com"));
siteData.Add(
new SiteDataItem(5, 2, "MSN", "http://www.msn.com"));
siteData.Add(
new SiteDataItem(6, 2, "Google", "http://www.google.com"));
siteData.Add(
new SiteDataItem(7, 3, "CNN", "http://www.cnn.com"));
siteData.Add(
new SiteDataItem(8, 3, "BBC", "http://www.bbc.co.uk"));
siteData.Add(
new SiteDataItem(9, 3, "FOX", "http://www.foxnews.com"));
RadTreeView1.DataTextField =
"Text";
RadTreeView1.DataNavigateUrlField =
"Url";
RadTreeView1.DataFieldID =
"ID";
RadTreeView1.DataFieldParentID =
"ParentID";
RadTreeView1.DataSource = siteData;
RadTreeView1.DataBind();
}
here is the output:
Note: