search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Update DataGrid after CallBack

Asked by Anonymous
16 years ago.

Hi, I try to Update a DataGrid on my WebSite after the scheduler did callback. Your description in DayPilot 4.1 "Sending custom data back to the client after callback" did not really help me.Has anybody an idea how to do this?

Comment posted by Dan Letecky
16 years ago.
I'm not sure whether the custom data sending method doesn't work for you or whether you need more explanation.

So I will give some general comments:

1) If you need maximum flexibility, you should place everything into an UpdatePanel (or a set of UpdatePanels) and use PostBack handling. Durign partial PostBacks, you will be able to read all controls and to modify controls placed inside UpdatePanel. But the price for this flexibility is the speed. Partial PostBacks send a lot of code back and forth and DayPilot goes through the full initialization procedure every time.

2) To speed things up, you can use CallBacks. But CallBacks also have a big drawback - you will only be able to read and modify DayPilot during CallBack:
a) Regular CallBack only updates the data (invoked after EventResize, EventMove, EventClick, etc.).
b) Refresh CallBack (invoked using .refreshCallBack) updates the data and a limited set of properties (generally StartDate, and Days).

In some cases, you can use the custom data trick (i.e. sending your own data using Update("data") from the server to the client with CallBack response) but if you need to update something as complex as DataGrid you should rather switch to UpdatePanel.
Comment posted by Anonymous
16 years ago.
Hi dan, thanks for your reply!

I found a very simple solution. I put only the datagrid into an update panel. After the callback from the scheduler the "AfterRenderJavascript" property call the "__postback("UpdatePanel", "");" function. The UpdatePanel do a partial postback and the grid is updated.

That works really fast.

Best regards from Germany
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.