M
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>
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>