I have a user control with a DataList object on it. Within the
<EditItemTemplate> I have a user control that is a special DropDownList
<asp:DataList ID="usercontrol1" Runat="Server"
<asp:Button ID="btnEdit" Runat="server" Text="Edit" CommandName="Edit"
CommandArgument='<%# Container.DataItem("ID") %>' />
<asp:Label ID="lblItem" Runat="server" Text='<%#
Container.DataItem("Line") %>' />
<mytag:MyDropDownList ID="ddlDropDownList" Runat="server"
SelectedValue='<%# Container.DataItem("Value") %>' />
My MyDropDownList component on page load calls a method that takes the
SelectedValue and sets the SelectedIndex of the DropDownList object in
MyDropDownList object. When I do this I receive "Object reference not set
to an instance of an object" errors. I've run tests and have found that the
SelectedValue property doesn't have a value either. It acts like the object
doesn't exist yet.
What do I have to do? What is the firing order of methods when I perform a
databind on the datalist?
Am I at least close?
Thanks, Keith Geringer