A
adam222
hello,
i have a web-form with a GridView control, i wanted to update & delete,
using the AutoGenerateEditButton.
when i used it with sqlDataSource (executing SP in the DB) it works
like a charm, but when i want to pass the data through the
application's layers (BL etc.), it did not work.
it seems that the 'AutoGenerateEditButton' is capable only with
sqlDataSource...
so i tried a work around:
protected void SqlDataSource1_Deleting(object sender,
SqlDataSourceCommandEventArgs e)
{
//get parameters
int systemId = X;
//use service to delete (layer)
Services.X APS = new Services.X();
serviceAPS.ServiceExecution(aps, null, ServiceActions.Delete);
//cancel original event
e.Cancel = true;
//reload data
GridView1.DataBind();
}
this worked! but this is crooked... i use the event of the
sqlDataSource to init a method & then canceling it...
the other thing that i have a problem with: the grid's binding is only
via sqlDataSource inner 'SelectCommand'
does anyone have a clue how can i use the edit/update/delete buttons
within the GridView & not with sqlDataSource?
thank you,
Adam
i have a web-form with a GridView control, i wanted to update & delete,
using the AutoGenerateEditButton.
when i used it with sqlDataSource (executing SP in the DB) it works
like a charm, but when i want to pass the data through the
application's layers (BL etc.), it did not work.
it seems that the 'AutoGenerateEditButton' is capable only with
sqlDataSource...
so i tried a work around:
protected void SqlDataSource1_Deleting(object sender,
SqlDataSourceCommandEventArgs e)
{
//get parameters
int systemId = X;
//use service to delete (layer)
Services.X APS = new Services.X();
serviceAPS.ServiceExecution(aps, null, ServiceActions.Delete);
//cancel original event
e.Cancel = true;
//reload data
GridView1.DataBind();
}
this worked! but this is crooked... i use the event of the
sqlDataSource to init a method & then canceling it...
the other thing that i have a problem with: the grid's binding is only
via sqlDataSource inner 'SelectCommand'
does anyone have a clue how can i use the edit/update/delete buttons
within the GridView & not with sqlDataSource?
thank you,
Adam