Hi,
try like this...
after executing the delete command... refresh the datasource ...and then
re-bind it with your grid.
Cheers,
Jerome. M
[quoted text, click to view] "RSusanto" wrote:
> Hi,
>
> I have a strange problem here.
> I use datagrid in my webform .aspx
> and I put delete button in the itemtempalate.
>
> So whenever delete button pressed, then I'm going to run the Item_Delete
> Public sub Item_Delete(ByVal source as object, e as
> DataGridCommandEventArgs)
> dim stSql as string
> stSql = "DELETE FROM tbParts WHERE ID = " &
> mydataGrid.DataKeys(e.Item.ItemIndex)
> ExecuteQuery(stSql)
> try
> MyDataGrid.EditItemIndex = -1
> BindGrid(true)
> catch ex as system.exception
> end try
> end sub
>
> the funny thing is when I'm going back to the main display of the datagrid
> it show the record still there (not deleted). But the reality was deleted.
> If I refresh the page then it won't show the deleted record.
>
> then I used Visual studio to trace it, when I trace everything run
> perfectly, it displayed the page with the data deleted not there anymore.
>
> But when I get back again to the browser and run it again, it show the
> deleted data again till I refresh the page.
>
> Anybody know what's going on in here ?
>
> Thanks
>
>
>