DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » How To » Update DataGrid after CallBack

Update DataGrid after CallBack

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?

Anonymous - 5/6/2008 10:03:05 AM
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.
Dan Letecky - 5/6/2008 6:20:04 PM
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
Anonymous - 5/6/2008 10:56:36 PM
Post reply