| <radA:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableOutsideScripts="true" |
| OnResolveUpdatedControls="RadAjaxManager1_ResolveUpdatedControls"> |
| <AjaxSettings> |
| <radA:AjaxSetting AjaxControlID="btnSearch"> |
| ... some code ... |
| </radA:AjaxSetting> |
| </AjaxSettings> |
| </radA:RadAjaxManager> |
| protected void RadAjaxManager1_ResolveUpdatedControls(object sender, UpdatedControlsEventArgs e) |
| { |
| e.UpdatedControls.Add(new AjaxUpdatedControl( |
| this.divgridheader.ClientID, string.Empty)); |
| } |

I am trying to databind a rad tree to a table that I create from a database. I followed the video example and changed the way I populate the table, but I know I am getting the correct data back. However, I get this error
Line 14: |
[NullReferenceException: Object reference not set to an instance of an object.] |
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
Here is the vb code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
' CreateChildControls the Table and assign the datasource
RadTreeView1.DataSource = CreateTable()
' Assign the data fields
RadTreeView1.DataFieldID = "ID"
RadTreeView1.DataFieldParentID = "ParentID"
RadTreeView1.DataTextField = "Text"
' Bind the data
RadTreeView1.DataBind()
End If
End Sub 'page_load
'this function creates a datatable for the rad
'tree that is in the events panel
Private Function CreateTable() As DataTable
'set up my connection to the database
Dim conn As New SqlConnection
conn.ConnectionString = ConfigurationManager.ConnectionStrings("connectionString").ConnectionString
Dim table As DataTable = New DataTable()
table.Columns.Add("ID")
table.Columns.Add("ParentID")
table.Columns.Add("Text")
'this is a counter for the id fields
'of the data table
Dim count As Integer = 0
'this adds the parent categories to the
'datatable
Dim categoryQuery As New SqlCommand
conn.Open()
categoryQuery.Connection = conn
categoryQuery.CommandText = "select CategoryId, Name from categories"
Dim cdr As SqlDataReader = categoryQuery.ExecuteReader()
While cdr.Read()
If (cdr.Item(0).ToString <> "") Then
table.Rows.Add(New String() {count.ToString, count.ToString, cdr.Item(1).ToString})
'we have to increment count to keep an id for the data table
count = count + 1
End If
End While 'while cdr.Read()
conn.Close()
conn.Open()
'this adds the events with their parent category
'id to the datatable
Dim eventQuery As New SqlCommand
eventQuery.Connection = conn
eventQuery.CommandText = "SELECT eventid, FK_CategoryID, name from events"
Dim edr As SqlDataReader = eventQuery.ExecuteReader()
While edr.Read()
If (edr.Item(0).ToString <> "") Then
table.Rows.Add(New String() {count.ToString(), edr.Item(1).ToString, edr.Item(2).ToString})
'we have to increment count to keep an id for the data table
count = count + 1
End If
End While 'while edr.Read()
Return table
End Function 'CreateGenreTable
What I can't understand is why it says that createtable is null. I am returning the table and I have outputted the data that I am adding to the table. Any ideas? Thanks

I tried surrounding the rsAvOptionsScroll div in the AdvancedForm with a UpdatePanel:
<asp:UpdatePanel ID="updtAdvFormControls" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
Then I tried dropping a standard Button and a RadTextBox on the form:
<asp:Button ID="btnResetSearch" runat="server" Text="Reset" OnClick="AddTeamMember2" Style="text-align: center;" />
<telerik:RadTextBox ID="RadTextBox1" runat="server">
</telerik:RadTextBox>
After that I created the callback function:
protected void AddTeamMember2(object sender, EventArgs e)
{
RadTextBox1.Text = "hhh";
updtAdvFormControls.Update();
}
When I clicked on the button the debugger goes into the AddTeamMember2 function
but the RadTextBox1 never gets set to "hhh" after it you hit F5 to continue. If I type in
"xxx" in the RadTextBox1 from the screen and then take the debugger back into the
AddTeamMember2 function, the value is set to "xxx" and latter gets set to "hhh" but
after hitting F5 to continue the screen always says "xxx".
Thanks,
Kip