Updating Datagrid from outside datagrid

  • Thread starter Patrick Delifer
  • 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
 
N

Natty Gur

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top