i have following direct event Handler in Code-Behind:
public void changeBlock(string blockname)
{
IntraNetEntities ent = new IntraNetEntities();
var query = from x in ent.Mailings_blocked where x.blocked == blockname select x;
if (query.Count() == 0)
{
Mailings_blocked add = new Mailings_blocked();
add.blocked = blockname;
ent.AddToMailings_blocked(add);
}
else
{
Mailings_blocked del = ent.Mailings_blocked.Single(c => c.blocked == blockname);
ent.DeleteObject(del);
}
ent.SaveChanges();
updateStore();
Grid_Business.RefreshView();
Grid_Mailing.RefreshView();
}
But when the Event is Triggered, the database gets updated, just like the store, but the RefreshView() is not correctly executed. when clicking any other Button for the same utility (this is a rowCommand) the view gets updated to desired state of one click earlier.
well i did not find out why, but i found out how to fix:
Calling the reload and render to after will not necessarily help, if the response time is high, because then after gets fired before success