473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 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 1100

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dabbler | last post by:
What is the best way to have a FormView page open on a specific row selected from a GridView? I'm passing the primary key in the url as in detailview.aspx?mode=edit&pk=42 I'm using an...
7
by: Lorenzino | last post by:
Hi, I have a problem with bindings in a formview. I have a formview; in the insert template i've created a wizard control and inside it i have an HTML table with some textboxes bound to the...
0
by: Chris | last post by:
I have treeview control I want to populate progamatically. It will sit in the edit and insert template of a formview. If I want to reference it with Formview1.FindControl("treeview1") and populate...
1
by: Ben | last post by:
I have a formview with a few dropdownlists (software version, database version, etc). When a software version is selected, the database version dropdownlist updates itself accordingly. When in...
1
by: mosscliffe | last post by:
Is it possible to get a GridView 'Select' to go straight to the 'Edit' of a Formview. If I add a 'New' button to the GridView can I get that to go straight to the Insert of a FormView. Is it...
1
by: Chris | last post by:
I have a treeview control, which I use to select a row in a table which will be used to populate a formview. Depending on what node is selected in the treeview I want the formview to be either in...
1
by: SteveT | last post by:
Before I pull out what little hair I have left, I'm swallowing my pride and asking the Oracles of .Net: I'm trying to set a property in a dropdown list control in a FormView, based on a session...
1
by: shapper | last post by:
Hello, I have a GridView where each row has an EDIT and a DELETE buttons. I also have a FormView with TextBoxes, DropDownLists, etc. When an EDIT button is pressed I make the...
1
by: mans | last post by:
Hello, I want to enable the edit template in a FormView from program. How can I do this? The FormView bound to a table and I don't want that it do the edit/add/delete but I control when it...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.