Updating Datagrid from outside datagrid

  • Thread starter Thread starter Patrick Delifer
  • Start date Start date
P

Patrick Delifer

HI,
I am trying to update a DataGrid where I want to rebind just the row that
was updated.
Here's the situation:
1) Updating is not a problem, it works fine.
2) I am not using ItemCommand (edit, delete, etc)
3) the button that issues the update/rebind is outside the datagrid, on the
web form.

Till now I have been issuing a full DataBind for the entire DG, that I read
as an Arraylist. But i would like to rebind only the row that was affected.
I looked into DataGridItem but how can I bind a DataSource to a DGitem?

here's a code snippet of how i do it now:

Order.UpdateOrder(int.Parse(lblOrderID.Text), txtWaybill.Text,
int.Parse(ddServices.SelectedValue), shippID, receivID, billtoid, );

ArrayList waybills = neworder.GetWaybills();

dgOrder.DataSource = waybills;

dgOrder.DataBind();




Thanx
 
Hi,

Databind apply to all grid rows but,

You can update row data on client side using DHTML and update DB using
your page, by using hidden iframe or XMLHttpRequest (depend on client
type) to call your page.

HttpRequest or iframe should hold client side form and then submit it to
server.

Your button should:
1) generate update request to server (using HttpRequest or iframe)
2) check return value and if it OK
3) use dhtml to update client side table.

HTH


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Back
Top