A
Andy Gilman
The designer does a great job of letting you map fields to a DataView but I
dont want to have to use the dataset it creates at runtime because I want to
be able to use my own dataset from my dataaccess layer. I want my display
components to be loosely coupled and more flexibly reusable
The designer generated code creates me 'dataView1' and binds all my controls
to it. What I wanted to do was bind the DataView to a new table at runtime
by using :
dataView1.Table = DataAccess.LoadCustomers();
This works, but only the first time. If I try and set it again it wont work
and all text fields are blanked out!
The MS help says "You can only set the Table property if the current value
is null."
So this implies I can only set it once. However the designer in its code has
already set it
//
// dataView1
//
this.dataView1.ApplyDefaultSort = true;
this.dataView1.Sort = "Customer_key";
this.dataView1.Table = this.tseDataSetTMDB1.customers;
So I must be able to set the Table property at least twice since the
designer has done it. Therefore what does this "You can only set the Table
property if the current value is null." comment mean?
How can I reset the table used by a DataView at runtime and have all its
bound controls work? Since the DataView is handling the proxying to the
table then surely this should be possible.
-simon
dont want to have to use the dataset it creates at runtime because I want to
be able to use my own dataset from my dataaccess layer. I want my display
components to be loosely coupled and more flexibly reusable
The designer generated code creates me 'dataView1' and binds all my controls
to it. What I wanted to do was bind the DataView to a new table at runtime
by using :
dataView1.Table = DataAccess.LoadCustomers();
This works, but only the first time. If I try and set it again it wont work
and all text fields are blanked out!
The MS help says "You can only set the Table property if the current value
is null."
So this implies I can only set it once. However the designer in its code has
already set it
//
// dataView1
//
this.dataView1.ApplyDefaultSort = true;
this.dataView1.Sort = "Customer_key";
this.dataView1.Table = this.tseDataSetTMDB1.customers;
So I must be able to set the Table property at least twice since the
designer has done it. Therefore what does this "You can only set the Table
property if the current value is null." comment mean?
How can I reset the table used by a DataView at runtime and have all its
bound controls work? Since the DataView is handling the proxying to the
table then surely this should be possible.
-simon