or
rDockModelPackage.ActiveWindowChanging+=
new
DockWindowCancelEventHandler(rDockModelPackage_ActiveWindowChanging);
rDockModelPackage.ActiveWindowChanged +=
new
DockWindowEventHandler(rDockModelPackage_ActiveWindowChanged);
}
private
void
rDockModelPackage_ActiveWindowChanged(
object
sender, DockWindowEventArgs e)
{
SizeAndColorSelectedDocWindowTab(e.DockWindow.TabStrip.TabStripElement, Color.Snow, Color.MistyRose);
}
private
void
rDockModelPackage_ActiveWindowChanging(
object
sender, DockWindowCancelEventArgs e)
{
SizeAndColorUnSelectedDocWindowTab(e.OldWindow.TabStrip.TabStripElement, Color.Snow, Color.MistyRose);
}
private
void
SizeAndColorSelectedDocWindowTab(RadTabStripElement win, Color lightColour, Color darkColour)
{
((FillPrimitive)win.Children[0].Children[0].Children[0].Children[0].Children[0]).BackColor = lightColour;
((FillPrimitive)win.Children[0].Children[0].Children[0].Children[0].Children[0]).BackColor2 = lightColour;
((FillPrimitive)win.Children[0].Children[0].Children[0].Children[0].Children[0]).BackColor3 = lightColour;
((FillPrimitive)win.Children[0].Children[0].Children[0].Children[0].Children[0]).BackColor4 = lightColour;
}
private
void
SizeAndColorUnSelectedDocWindowTab(RadTabStripElement win, Color lightColour, Color darkColour)
{
((FillPrimitive)win.Children[0].Children[0].Children[0].Children[0].Children[0]).BackColor = darkColour;
((FillPrimitive)win.Children[0].Children[0].Children[0].Children[0].Children[0]).BackColor2 = darkColour;
((FillPrimitive)win.Children[0].Children[0].Children[0].Children[0].Children[0]).BackColor3 = darkColour;
((FillPrimitive)win.Children[0].Children[0].Children[0].Children[0].Children[0]).BackColor4 = darkColour;
}
Dim DS_Assets As DataSet |
sqlQuery = "SELECT location.location_id, location.site_id, location.description, location.code, location.site_id, " & _ |
"asset.asset_tag, asset.serial_number, asset.item_id, asset.date_updated, " & _ |
"item.description " & _ |
"FROM location INNER JOIN asset ON location.location_id = asset.location_id INNER JOIN item ON asset.item_id = item.item_id " & _ |
"WHERE location.site_id=" & Site |
DS_Assets = common.DBConnect(sqlQuery, "assets", activeDBServer, activeDBName, activeDBUser, activeDBPass) ' This is the function that returns the Dataset |
Me.RadGridView1.MasterGridViewTemplate.Columns.Clear() |
Me.RadGridView1.MasterGridViewTemplate.GroupByExpressions.Clear() |
Me.RadGridView1.MasterGridViewTemplate.SortExpressions.Clear() |
Me.RadGridView1.MasterGridViewTemplate.AllowAddNewRow = False |
Me.RadGridView1.MasterGridViewTemplate.AutoGenerateColumns = False |
Me.RadGridView1.MasterGridViewTemplate.EnableGrouping = False |
Me.RadGridView1.DataSource = DS_Assets.Tables(0) |
The error is thrown on the last line when I try to bind the data to the gridview. There are about 3300 rows in the data being returned. If I look at the inner exception it is returning "NullReferenceException: Object reference not set to an instance of an object."
But the data is there, the Dataset is correct. I have run this code on a regular GridView control and it works fine. Just won't work on the RadGridView. Any ideas what I am doing wrong?