Don,
,
> I don't know if this is because I'm binding to an entitylist or if it's something dumb I'm doing.
>
>I have a button that triggers a search and then should populate a gridview with the entitylist of that search. However,
>I cannot get it to bind to the data in the click event of the button. If I click the button, the first time through
>nothing happens. If I click it the second time, it populates fine. The data is always one click behind the
>button. As you can see I've tried binding and rebinding all over the place but I seem to be missing some
>clue about the page life cycle or binding in general.
In an ASP.NET app, when you click the button, the web form's Page_Load() fires first, and since you have clicked the button, IsPostBack is true, and your foreach loop executes. Next, your btnMoveToNewYear_Click() method fires and the code overwrites the EntityList you created in the page load.
Are you using the MM .NET data binding properties?
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com