469,623 Members | 1,407 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Finding a GridView in FormView

MRW
For some strange reason, I'm having problems finding a GridView in a
FormView. I keep getting the error:

Object reference not set to an instance of an object.

I have the code below, it's very simple, yet I can't 'grab' my
gridview. Can anybody help me out on this?
----

Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs)
FV.ChangeMode(FormViewMode.Edit)
If FV.CurrentMode = FormViewMode.Edit Then
Dim GV1 As GridView = FV.FindControl("GV")
GV1.Enabled = False <----Error occurs here
End If
End Sub

---

<asp:FormView ID="FV" runat="server">
<EditItemTemplate<asp:GridView ID="GV"
AutoGenerateColumns=true
runat=server></asp:GridView></EditItemTemplate>
</asp:FormView>

Sep 7 '06 #1
0 982

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dabbler | last post: by
1 post views Thread by Kyle K. | last post: by
1 post views Thread by joechipubik | last post: by
reply views Thread by ThePurpleCat | last post: by
2 posts views Thread by needin4mation | last post: by
reply views Thread by Q. John Chen | last post: by
5 posts views Thread by =?Utf-8?B?QWRhciBXZXNsZXk=?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.