Display BindData() not refreshed automaticly

R

RSusanto

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
 
G

Guest

Hi,

try like this...

after executing the delete command... refresh the datasource ...and then
re-bind it with your grid.

Cheers,

Jerome. M
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top