Hi,
I'd like to be able to filter my grid using ajax while in a modal telerik window. Each time I press enter in a filter field, the page posts back and the modal window is lost. Is this possible?
If I remove the window, the grid filters perfectly using ajax without postback.
I've pasted my code below.
Thanks!
Stephen
I'd like to be able to filter my grid using ajax while in a modal telerik window. Each time I press enter in a filter field, the page posts back and the modal window is lost. Is this possible?
If I remove the window, the grid filters perfectly using ajax without postback.
I've pasted my code below.
Thanks!
Stephen
01.
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
02.
<
Scripts
>
03.
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
>
04.
</
asp:ScriptReference
>
05.
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
>
06.
</
asp:ScriptReference
>
07.
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
>
08.
</
asp:ScriptReference
>
09.
</
Scripts
>
10.
</
telerik:RadScriptManager
>
11.
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
12.
<
AjaxSettings
>
13.
<
telerik:AjaxSetting
AjaxControlID
=
"Panel1"
>
14.
<
UpdatedControls
>
15.
<
telerik:AjaxUpdatedControl
ControlID
=
"Panel1"
/>
16.
</
UpdatedControls
>
17.
</
telerik:AjaxSetting
>
18.
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
19.
<
UpdatedControls
>
20.
<
telerik:AjaxUpdatedControl
ControlID
=
"Panel1"
/>
21.
<
telerik:AjaxUpdatedControl
ControlID
=
"txtNIGPCode"
/>
22.
</
UpdatedControls
>
23.
</
telerik:AjaxSetting
>
24.
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
25.
<
UpdatedControls
>
26.
<
telerik:AjaxUpdatedControl
ControlID
=
"txtNIGPCode"
/>
27.
</
UpdatedControls
>
28.
</
telerik:AjaxSetting
>
29.
</
AjaxSettings
>
30.
</
telerik:RadAjaxManager
>
31.
<
telerik:RadAjaxLoadingPanel
ID
=
"nigpLoadingPanel"
runat
=
"server"
Skin
=
"Default"
></
telerik:RadAjaxLoadingPanel
>
32.
33.
<
telerik:RadWindow
ID
=
"RadWindow1"
runat
=
"server"
Modal
=
"True"
Behaviors
=
"Close"
IconUrl
=
" "
Behavior
=
"Close"
>
34.
35.
<
ContentTemplate
>
36.
37.
<
asp:Panel
ID
=
"Panel1"
runat
=
"server"
>
38.
39.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AutoGenerateColumns
=
"False"
DataSourceID
=
"dsNIGP"
OnSelectedIndexChanged
=
"RadGrid1_SelectedIndexChanged"
CellSpacing
=
"0"
GridLines
=
"None"
>
40.
<
GroupingSettings
CaseSensitive
=
"false"
/>
41.
<
MasterTableView
DataKeyNames
=
"GT_NIGP_Code"
>
42.
<
Columns
>
43.
<
telerik:GridButtonColumn
Text
=
"Select"
CommandName
=
"Select"
></
telerik:GridButtonColumn
>
44.
<
telerik:GridBoundColumn
HeaderText
=
"Code"
ReadOnly
=
"true"
DataField
=
"GT_NIGP_Code"
SortExpression
=
"GT_NIGP_Code"
AutoPostBackOnFilter
=
"true"
ShowFilterIcon
=
"false"
CurrentFilterFunction
=
"Contains"
/>
45.
<
telerik:GridBoundColumn
HeaderText
=
"Description"
ReadOnly
=
"true"
DataField
=
"DESCR"
SortExpression
=
"DESCR"
AutoPostBackOnFilter
=
"true"
ShowFilterIcon
=
"false"
CurrentFilterFunction
=
"Contains"
/>
46.
</
Columns
>
47.
</
MasterTableView
>
48.
</
telerik:RadGrid
>
49.
<
asp:EntityDataSource
ID
=
"dsNIGP"
runat
=
"server"
ConnectionString
=
"name=VendorProfileEntities"
DefaultContainerName
=
"VendorProfileEntities"
EnableFlattening
=
"False"
EntitySetName
=
"GT_NIGP"
OrderBy
=
"it.GT_NIGP_Code"
>
50.
</
asp:EntityDataSource
>
51.
52.
</
asp:Panel
>
53.
</
ContentTemplate
>
54.
</
telerik:RadWindow
>
55.
56.
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
57.
<
script
type
=
"text/javascript"
>
58.
/* Using radopen */
59.
function ShowExisting1() {
60.
//Show an existing window
61.
var oWnd = $find("<%= RadWindow1.ClientID %>");
62.
oWnd.show();
63.
//First argument is the URL. Since no url is provided, the NavigateUrl property set on the server will be used.
64.
}
65.
66.
</
script
>
67.
</
telerik:RadScriptBlock
>
68.
69.
NIGP Code:
70.
<
asp:TextBox
ID
=
"txtNIGPCode"
runat
=
"server"
></
asp:TextBox
>
71.
<
button
onclick
=
"ShowExisting1();return false;"
class
=
"Button"
>Lookup</
button
>