1. I am using the dnnGrid on a page inside of the standard dotnetnuke Tabs and Expand/Collapse controls.
2. I am initializing the dotnetnuke tabs and expand/collapse controls using the exact code from the demo video (on this site)
3. Each time an ajax call is made from the grid control it adds one iteration to the animation sequence of the expand/collapse controls. So if I click the "Add Record" button on the grid, then click the collapse button on the containing control, it will collapse, then expand. Each click within the grid control causes one more iteration to the expand/collapse control.
How should the standard code be modified to prevent the expand/collapse controls from being repeatedly initialized when an ajax call is being made?
<%@ Control language="vb" Inherits="DotNetNuke.Modules.ZenoITSettings.View" AutoEventWireup="false" Explicit="True" Codebehind="View.ascx.vb" %>
<%@ Register Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" TagPrefix="cc1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<
asp:Panel
runat
=
"server"
id
=
"pnlContent"
>
<
div
class
=
"dnnForm dnnSiteSettings dnnClear"
id
=
"dnnSiteSettings"
>
<
ul
class
=
"dnnAdminTabNav dnnClear"
>
<
li
><
a
href
=
"#ssBasicSettings"
>Basic Settings</
a
></
li
>
<
li
><
a
href
=
"#ssIdentifications"
>Identifications</
a
></
li
>
</
ul
>
<
div
class
=
"ssBasicSettings dnnClear"
id
=
"ssBasicSettings"
>
<
h2
class
=
"dnnFormSectionHead"
id
=
"Sec1"
>
<
a
href
=
""
class
=
"dnnSectionExpanded"
>DotNetNuke Integration</
a
>
</
h2
>
<
fieldset
>
<
div
class
=
"dnnFormItem"
>
<
dnn:Label
id
=
"lblSchoolAdmin"
runat
=
"Server"
ControlName
=
"cmbSchoolAdmin"
/>
<
asp:DropDownList
ID
=
"cmbSchoolAdmin"
CssClass
=
"dnnFormRequired"
runat
=
"server"
/>
</
div
>
<
fieldset
>
</
div
>
<
div
class
=
"ssAdvancedSettings dnnClear"
id
=
"ssIdentifications"
>
<
h2
class
=
"dnnFormSectionHead"
id
=
"h6"
>
<
a
href
=
""
class
=
""
>State License Numbers</
a
>
</
h2
>
<
fieldset
>
<
telerik:RadAjaxLoadingPanel
Runat
=
"server"
Skin
=
"Default"
id
=
"RadAjaxLoadingPanel1"
></
telerik:RadAjaxLoadingPanel
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"gridIDs"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"gridIDs"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
></
telerik:AjaxUpdatedControl
>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxPanel
runat
=
"server"
width
=
"60%"
height
=
"300px"
>
<
cc1:DnnGrid
runat
=
"server"
id
=
"gridIDs"
name
=
"gridIDs"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowAutomaticDeletes
=
"True"
AutoGenerateColumns
=
"False"
ShowHeader
=
"True"
ShowFooter
=
"True"
ShowStatusBar
=
"True"
Skin
=
"Office2010Blue"
EnableAJAX
=
"True"
AllowSorting
=
"True"
OnNeedDataSource
=
"gridIDs_NeedDataSource"
OnUpdateCommand
=
"gridIDs_UpdateCommand"
OnInsertCommand
=
"gridIDs_InsertCommand"
>
<
pagerstyle
mode
=
"NextPrevNumericAndAdvanced"
/>
<
MasterTableView
CommandItemDisplay
=
"Top"
EditMode
=
"InPlace"
DataKeyNames
=
"UIDSchoolIdentification"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowAutomaticDeletes
=
"True"
>
<
CommandItemSettings
AddNewRecordText
=
"Add Record"
ShowAddNewRecordButton
=
"True"
ShowRefreshButton
=
"True"
></
CommandItemSettings
>
<
columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
Reorderable
=
"False"
ShowSortIcon
=
"False"
>
<
HeaderStyle
Width
=
"63px"
/>
<
ItemStyle
HorizontalAlign
=
"Center"
/>
</
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"Delete"
ButtonType
=
"ImageButton"
>
<
HeaderStyle
Width
=
"25px"
/>
<
ItemStyle
HorizontalAlign
=
"Center"
/>
</
telerik:GridButtonColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"TemplateColumn"
HeaderText
=
"State"
DataField
=
"State.StateName"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblState"
runat
=
"server"
></
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:DropDownList
ID
=
"cmbStates"
runat
=
"server"
/>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"ProviderID"
HeaderText
=
"Provider ID"
DataField
=
"ProviderID"
/>
</
columns
>
</
MasterTableView
>
</
cc1:DnnGrid
>
</
telerik:RadAjaxPanel
>
</
fieldset
>
</
div
>
<
asp:linkbutton
runat
=
"server"
text
=
"Update"
ID
=
"cmdUpdate"
CssClass
=
"dnnPrimaryAction"
/>
<
asp:label
runat
=
"server"
id
=
"lblUpdate"
text
=
""
/>
</
div
>
</
asp:Panel
>
<
asp:Panel
id
=
"pnlSetup"
runat
=
"server"
>
<
h3
>Initial Setup Instructions</
h3
>
<
p
>Please go into this module's settings and <
strong
>set the connection string</
strong
> to the ZenoIT database, then <
strong
>click the Test Connection button</
strong
>.</
p
>
<
p
>You must then <
strong
>specify your assigned School ID </
strong
>(an alpha numeric value in this format: 00000000-0000-0000-0000-0000000000000)</
p
>
<
p
><
em
>Once the settings have been set, click the Update button in the Settings screen and this area will contain configuration options.</
em
></
p
>
</
asp:Panel
>
<
telerik:radscriptblock
runat
=
"server"
>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
(function ($, Sys) {
function setupDnnSiteSettings() {
$('#dnnSiteSettings').dnnTabs().dnnPanels();
$('#ssBasicSettings .dnnFormExpandContent a').dnnExpandAll({ expandText: 'ExpandAll', collapseText: 'CollapseAll', targetArea: '#ssBasicSettings' });
$('#ssIdentifications .dnnFormExpandContent a').dnnExpandAll({ expandText: 'ExpandAll', collapseText: 'CollapseAll', targetArea: '#ssIdentifications'
});
}
$(document).ready(function () {
setupDnnSiteSettings();
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
setupDnnSiteSettings();
});
});
} (jQuery, window.Sys));
</
script
>
</
telerik:radscriptblock
>