W
Wayne Brantley
I have a grid connected to an ObjectDataSource and everything works and
updates fine. I am using VS2005's dataset designer to create the
dataset/tableadapters and developing in ASP.NET.
What I am now trying to do is to update column A when column B changes.
(This cannot be done at the SQL level as it requires resource not accessable
from SQL). So, I simply added a class to my project where I would extend
the DataTable class. Turns out that ColumnChanged event never gets called.
After further research, turns out that RowChanged event never gets called
with any action other than Add or Commit (but it does get called, so I know
my partial class extension and initialization was done right). So, it is
as if the ObjectDataSource never actually 'changes' any rows?
public partial class Dataset1{
public partial class DataTable1{
public override void BeginInit(){
this.RowChanged += new DataRowChangeEventHandler(Row_Changed);
this.ColumnChanged += new
DataColumnChangeEventHandler(Column_Changed);
base.BeginInit();
}
private void FontsDataTable_ColumnChanged(object sender,
DataColumnChangeEventArgs e){
string x = "est"; //Just random code, put a breakpoint here,
never called..
x = x + "test";
}
private void Row_Changed(object sender, DataRowChangeEventArgs e){
if (e.Action == DataRowAction.Change) { //This line will be
called, but action is never change...
string x = "est";
x = x + "test";
}
}
}
}
Wayne
updates fine. I am using VS2005's dataset designer to create the
dataset/tableadapters and developing in ASP.NET.
What I am now trying to do is to update column A when column B changes.
(This cannot be done at the SQL level as it requires resource not accessable
from SQL). So, I simply added a class to my project where I would extend
the DataTable class. Turns out that ColumnChanged event never gets called.
After further research, turns out that RowChanged event never gets called
with any action other than Add or Commit (but it does get called, so I know
my partial class extension and initialization was done right). So, it is
as if the ObjectDataSource never actually 'changes' any rows?
public partial class Dataset1{
public partial class DataTable1{
public override void BeginInit(){
this.RowChanged += new DataRowChangeEventHandler(Row_Changed);
this.ColumnChanged += new
DataColumnChangeEventHandler(Column_Changed);
base.BeginInit();
}
private void FontsDataTable_ColumnChanged(object sender,
DataColumnChangeEventArgs e){
string x = "est"; //Just random code, put a breakpoint here,
never called..
x = x + "test";
}
private void Row_Changed(object sender, DataRowChangeEventArgs e){
if (e.Action == DataRowAction.Change) { //This line will be
called, but action is never change...
string x = "est";
x = x + "test";
}
}
}
}
Wayne