471,075 Members | 948 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

Default Edit Formview error

I am using the formview control. Within its edit template I have a treeview,
which I populate programatically. Initially I had an item template in which
I had a button, which triggered the edit template. The treeview was
populated with the following code

Protected Sub FormView1_ItemCreated(ByVal sender As Object, ByVal e As
System.EventArgs)
If FormView1.CurrentMode = FormViewMode.Edit Or FormView1.CurrentMode =
FormViewMode.Insert Then
Dim tw As TreeView
tw = New TreeView()
tw = FormView1.Row.FindControl("treeview1")
tw.Nodes.Clear()
GetFolders(Server.MapPath(""), tw.Nodes)
End If
End Sub

However when I change the formview's default view to edit I keep getting an
'Object reference not set to an instance of an object' error when I try to
find the treeview. I'm a bit stumped. Can anyone help? Regards, Chris.
May 28 '06 #1
0 1043

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by mosscliffe | last post: by
1 post views Thread by SteveT | last post: by
1 post views Thread by shapper | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.