Really frustrated here, and i feel like a real newb struggling with this. I've always been a WebForm guy, but I've recently found a need for myself to learn WinForm development. I've been using Csla for a good while now, but I'm pulling my hair out with refreshing the winform UI properly with a DataGridView:
I have a button that invokes my BO's Get and sets the bindingSource1.DataSource = myObject. Trouble is, the UI doesn't update until the button is clicked twice! Very confusing. I can't seem to understand why, as I've wasted most of the day trying to research this :( Oddly enough, I've stepped through the code, and the dang DataSource will contain values on the first click! but they don't show up on the UI!
the current code for the onclick event of the fetchList button:
private
void btnGet_Click(object sender, EventArgs e){
this.bindingSource1.RaiseListChangedEvents = false;_cowList =
CowList.GetCowList(txtSponsorId.Text, txtAuthId.Text);//where _cowList is a global property this.bindingSource1.DataSource = _cowList; this.bindingSource1.RaiseListChangedEvents = true;}
Copyright (c) Marimer LLC