Dear All!
I'm encountering a really strange behaviour:
I have a RadGrid on my page, which displays a two-level hierarchy. OnNeedDataSource and DetailTableDataBind - events are used for assigning data to the grids. Additionally there is an AjaxManager, which updates the grid itself and a further dependent RadGrid (unimportant). HierarchyLoadMode is set to "ServerOnDemand". Data insertion/deletion/updating is done with the default in-line editors (server-side events aren't implemented yet). So far, nothing special at all...
Everything worked fine, until I added export-buttons into the command-item. I have read the documentation carefully and therefor added the javascript-method to un-ajaxify the 3 export-buttons.
Here is the code:
This client-side function is registered like the following:
The problem:
If I open up the page in a web-browser and want to expand any record immediately, it doesn't work as long as I don't click a second record, or do anything which triggers an ajax-request!
For example: Before I can expand any record, I could click on it, so that there is a SelectionChangedEvent being raised (ajax-request is ok) and after that everything is normal.
My solution-attempt:
If I remove the "ClientEvents-OnRequestStart" - from the AjaxManager-definition everything is ok. Therefor I believe it must have something to do with the initial registration of the javascript-functions which make a record expand or collapse.
Any help or tips appreciated!
Best regards,
Daniel Lang
I'm encountering a really strange behaviour:
I have a RadGrid on my page, which displays a two-level hierarchy. OnNeedDataSource and DetailTableDataBind - events are used for assigning data to the grids. Additionally there is an AjaxManager, which updates the grid itself and a further dependent RadGrid (unimportant). HierarchyLoadMode is set to "ServerOnDemand". Data insertion/deletion/updating is done with the default in-line editors (server-side events aren't implemented yet). So far, nothing special at all...
Everything worked fine, until I added export-buttons into the command-item. I have read the documentation carefully and therefor added the javascript-method to un-ajaxify the 3 export-buttons.
Here is the code:
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| function mngRequestStarted(ajaxManager, eventArgs) { |
| if (eventArgs.get_eventTarget().indexOf("btnExportToPDF") != -1) |
| eventArgs.set_enableAjax(false); |
| if (eventArgs.get_eventTarget().indexOf("btnExportToExcel") != -1) |
| eventArgs.set_enableAjax(false); |
| if (eventArgs.get_eventTarget().indexOf("btnExportToCSV") != -1) |
| eventArgs.set_enableAjax(false); |
| } |
| </script> |
| </telerik:RadCodeBlock> |
This client-side function is registered like the following:
| <telerik:RadAjaxManager runat="server" EnablePageHeadUpdate="False" ClientEvents-OnRequestStart="mngRequestStarted"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="gridTasks"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="gridTasks"/> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="gridTasks" EventName="OnSelectedIndexChanged"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="lblNoSelectionText" /> |
| <telerik:AjaxUpdatedControl ControlID="pnlTimeEntryPanel"/> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="chkShowProj... |
| ### further code ### |
The problem:
If I open up the page in a web-browser and want to expand any record immediately, it doesn't work as long as I don't click a second record, or do anything which triggers an ajax-request!
For example: Before I can expand any record, I could click on it, so that there is a SelectionChangedEvent being raised (ajax-request is ok) and after that everything is normal.
My solution-attempt:
If I remove the "ClientEvents-OnRequestStart" - from the AjaxManager-definition everything is ok. Therefor I believe it must have something to do with the initial registration of the javascript-functions which make a record expand or collapse.
Any help or tips appreciated!
Best regards,
Daniel Lang