Events Lifecycle
The API and event sequence of RadDataForm are quite similar to RadListView .The sequence of the events is as follows.
RadDataForm with EnableViewState set to true (default value)
First page load
- Page.Load
- NeedDataSource
- ItemCreated for each item
- ItemDataBound for each item
- Page.PreRender
Normal postback from a control outside of RadListView
- ItemCreated for each item in RadDataForm
- Page.Load
- Postback Events
- Page.PreRender
On edit/update/insert/delete/cancel action or paging/sorting operation
- ItemCreated for each item in RadDataForm
- Page.Load
- ItemCommand
- ItemEditing / ItemUpdating / ItemInserting / ItemDeleting / ItemCanceling
- ItemEdited / ItemUpdated / ItemInserted / ItemDeleted / PageIndexChanged
- NeedDataSource
- ItemCreated for each item in RadDataForm
- ItemDataBound for each item in RadDataForm
- Page.PreRender
Calling Rebind()
Invoking the Rebind()
method from a postback event handler of an outside control or RadDataForm will raise the NeedDataSource event. Then the data form items will be recreated and ItemCreated
and ItemDataBound
events will be raised according to the cases above.
RadDataForm with EnableViewState set to false
First page load
- Page.Load
- NeedDataSource
- ItemCreated for each item in RadDataForm
- ItemDataBound for each item in RadDataForm
- Page.PreRender
Normal postback from a control outside of RadDataForm
- NeedDataSource
- ItemCreated for each item in RadDataForm
- ItemDataBound for each item in RadDataForm
- Page.Load
- Postback Events
- Page.PreRender
On edit/update/insert/delete/cancel/paging operation
- NeedDataSource
- ItemCreated for each item in RadDataForm
- ItemDataBound for each item in RadDataForm
- Page.Load
- ItemCommand
- ItemEditing / ItemUpdating / ItemInserting / ItemDeleting / ItemCanceling
- ItemEdited / ItemUpdated / ItemInserted / ItemDeleted / ItemCancelled / PageIndexChanged
- ItemCreated for each item in RadDataForm
- ItemDataBound for each item in RadDataForm
- Page.PreRender
Calling Rebind()
Invoking the Rebind()
method from postback event handler of an outside control or RadDataForm will not raise the NeedDataSource event. Then the data form items will be recreated so the ItemCreated
and ItemDataBound
events will be raised according to the cases above.