or
<
telerik:RadGrid
runat
=
"server"
ID
=
"gridMedications"
OnItemDataBound
=
"gridMedications_ItemDataBound"
OnInsertCommand
=
"gridMedications_InsertCommand"
OnDeleteCommand
=
"gridMedications_DeleteCommand"
>
<
MasterTableView
AutoGenerateColumns
=
"false"
NoMasterRecordsText="<i><
b
>None - Not taking any medications</
b
></
i
>"
CommandItemDisplay="Bottom" EditMode="EditForms" >
<
CommandItemSettings
AddNewRecordText
=
"Add Medication"
ShowAddNewRecordButton
=
"true"
ShowRefreshButton
=
"false"
/>
<
EditFormSettings
EditColumn-InsertText
=
"Add"
EditColumn-ButtonType
=
"PushButton"
/>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"NameOfMed"
HeaderText
=
"Medication"
UniqueName
=
"NameOfMed"
>
<
ColumnValidationSettings
EnableRequiredFieldValidation
=
"true"
>
<
RequiredFieldValidator
SetFocusOnError
=
"true"
Display
=
"Dynamic"
ForeColor
=
"Red"
Text
=
" *Required"
/>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ReasonForTaking"
HeaderText
=
"Reason for Taking"
UniqueName
=
"ReasonForTaking"
DefaultInsertValue
=
""
/>
<
telerik:GridBoundColumn
DataField
=
"FormOfMed"
HeaderText
=
"Form Of Medication"
UniqueName
=
"FormOfMedCol"
ReadOnly
=
"true"
/>
<
telerik:GridBoundColumn
DataField
=
"Prescription"
HeaderText
=
"Rx or OTC"
UniqueName
=
"PrescriptionCol"
ReadOnly
=
"true"
/>
<
telerik:GridBoundColumn
DataField
=
"ForAllergies"
HeaderText
=
"For Allergies?"
UniqueName
=
"ForAllergiesCol"
ReadOnly
=
"true"
/>
<
telerik:GridDropDownColumn
DataField
=
"FormOfMed"
HeaderText
=
"Form Of Medication"
UniqueName
=
"FormOfMed"
Visible
=
"false"
ReadOnly
=
"false"
/>
<
telerik:GridDropDownColumn
DataField
=
"Prescription"
HeaderText
=
"Rx or OTC"
UniqueName
=
"Prescription"
Visible
=
"false"
ReadOnly
=
"false"
/>
<
telerik:GridDropDownColumn
DataField
=
"ForAllergies"
HeaderText
=
"For Allergies?"
UniqueName
=
"ForAllergies"
Visible
=
"false"
ReadOnly
=
"false"
/>
<
telerik:GridButtonColumn
ButtonType
=
"LinkButton"
Text
=
"Remove"
CommandName
=
"Delete"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:RadCodeBlock
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function pageLoad(sender, eventArgs) {
if (!eventArgs.get_isPartialLoad()) {
$find("<%=RadAjaxManager1.ClientID%>").ajaxRequest("InitialPageLoad");
}
}
.....
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
></
asp:ScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"MainContentPanel"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
......
<
div
id
=
"mainContent"
>
<
section
class
=
"container-content"
>
<
div
class
=
"bottom-container-content"
>
<
div
class
=
"content-page"
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
></
telerik:RadAjaxLoadingPanel
>
<
asp:Panel
ID
=
"MainContentPanel"
runat
=
"server"
>
<
asp:Panel
ID
=
"AjaxMainContentPanel"
runat
=
"server"
Visible
=
"false"
>
<
asp:ContentPlaceHolder
ID
=
"MainContent"
runat
=
"server"
></
asp:ContentPlaceHolder
>
</
asp:Panel
>
</
asp:Panel
>
.......
Private
Sub
RadAjaxManager1_AjaxRequest(sender
As
Object
, e
As
Telerik.Web.UI.AjaxRequestEventArgs)
Handles
RadAjaxManager1.AjaxRequest
If
e.Argument =
"InitialPageLoad"
Then
AjaxMainContentPanel.Visible =
True
End
If
End
Sub
Although the page seems to load in the correct order, master and content page layout, menus, images, etc... the RadAjaxLoadingPanel does not show.
I have a RadGrid on the content page being loaded from some very heavy queries which can take up to 5 seconds, and the place where the grid would show is blank until the data is loaded.
Problem 2 - RadGrid's NeedDataSource event will not fire with the above scenario:
Code for Content.aspx:
<
asp:Content
ID
=
"Content3"
ContentPlaceHolderID
=
"MainContent"
runat
=
"server"
>
<
telerik:RadAjaxManagerProxy
ID
=
"AjaxManagerProxy1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"AjaxManagerProxy1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rdList"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
telerik:RadGrid
ID
=
"rdList"
runat
=
"server"
AllowPaging
=
"False"
Skin
=
"Silk"
AllowMultiRowSelection
=
"true"
AutoGenerateColumns
=
"false"
>
<
MasterTableView
>
<
Columns
>
.....
Private
Sub
rdList_NeedDataSource(sender
As
Object
, e
As
Telerik.Web.UI.GridNeedDataSourceEventArgs)
Handles
rdList.NeedDataSource
LoadGrid()
End
Sub
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
If
Not
Page.IsPostBack
Then
Else
If
PageIsLoaded.Value <>
"true"
Then
rdList.Rebind()
PageIsLoaded.Value =
"true"
End
If
End
If
End
Sub