View Single Post
  #6 (permalink)  
Old August 27th, 2004, 09:59 AM
gdbjohnson gdbjohnson is offline
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The IsPostBack looks to be an ASP specific property?

I'm pretty sure that my binding's are set up correctly.
in the Page_Load event:
Code:
adpContact = new SqlDataAdapter(strSQL, sqlConn);            
adpAddress = new SqlDataAdapter(strSQL, sqlConn);

//Configure DataSet
dsContact = new DataSet("dsContact");
adpAddress.Fill(dsContact, "Address");
adpContact.Fill(dsContact, "Contact");
dsContact.Relations.Add( "FK_Address_Contact", dsContact.Tables["Address"].Columns["AddressID"], dsContact.Tables["Contact"].Columns["AddressID"]);

//Configure DataViewManager over DataSet dsContact
dvContact = new DataViewManager(dsContact);
dvContact.DataViewSettings["Contact"].Sort = "LastName";
//dvContact.DataViewSettings["Contact"].RowFilter = "ContactID >= 2";

dvContact.DataViewSettings["Address"].Sort = "AddressID";
//dvContact.DataViewSettings["Address"].RowFilter = "AddressID


txtCity.DataBindings.Add("Text", dvContact, "Address.City");

Binding bn = new Binding("Text", this.BindingContext[dvContact, "Contact"], "Position");
bn.Format += new ConvertEventHandler(this.FormatRecPosition);
txtRecPosition.DataBindings.Add(bn);

BindingManagerBase b;
b = this.BindingContext[dvContact, "Contact"];
b.CurrentChanged += new System.EventHandler(this.ContactBinding_CurrentChanged);

b = this.BindingContext[dvContact, "Address"];
b.CurrentChanged += new System.EventHandler(this.AddressBinding_CurrentChanged);
I was thinking that maybe after the filter gets applied, although the data changes, the position number stays the same (at 0) which is why the databound controls do not update... maybe the position value is the trigger?

-g

Reply With Quote