关闭radwindow后网格刷新问题
我在 radgrid 刷新方面遇到问题,当我关闭弹出的 radwindow 时,任何人都可以帮助解决这个问题。
我的 Gridpage aspx 代码看起来像这样
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" EnableAJAX="true">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
GridLines="None" ShowGroupPanel="True" Skin="Black" AutoGenerateColumns="False" Width="100%" AllowAutomaticInserts="false" AllowAutomaticUpdates="false">
<ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" ReorderColumnsOnClient="True">
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<ClientEvents OnGridCreated="OnGridCreated" />
</ClientSettings>
.......................
..................
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
Skin="Black">
<Windows>
<telerik:RadWindow ID="UserListDialog" runat="server" Height="620px" Width="620px"
Left="150px" Top="50px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true"
OnClientClose="closeRadWindow" />
</Windows>
</telerik:RadWindowManager>
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
if (e.Argument == "Rebind")
{
RadGrid1.MasterTableView.SortExpressions.Clear();
RadGrid1.MasterTableView.GroupByExpressions.Clear();
Presenter List = new Presenter(this);
IList<FileAdmin> GridDta = List.PopulateGrid();
RadGrid1.DataSource = GridDta;
RadGrid1.Rebind();
}
My javascript looks like this
function closeRadWindow()
{
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
function refreshGrid()
{
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
RadWindow aspx 代码看起来像这样 javascript
function CloseAndRebind() {
GetRadWindow().BrowserWindow.refreshGrid();
//GetRadWindow().close();
}
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
Radwindow aspx.cs 文件如下所示
protected void buttonclick(object sender, EventArgs e)
{
if (result == true)
{
ClientScript.RegisterStartupScript(Page.GetType(), "mykey1", "CloseAndRebind();", true);
}
}
I have problem with radgrid refreshing, when i close the popuup radwindow,can any one help to figure out the problem.
my Gridpage aspx code looks like this
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" EnableAJAX="true">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
GridLines="None" ShowGroupPanel="True" Skin="Black" AutoGenerateColumns="False" Width="100%" AllowAutomaticInserts="false" AllowAutomaticUpdates="false">
<ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" ReorderColumnsOnClient="True">
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<ClientEvents OnGridCreated="OnGridCreated" />
</ClientSettings>
.......................
..................
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
Skin="Black">
<Windows>
<telerik:RadWindow ID="UserListDialog" runat="server" Height="620px" Width="620px"
Left="150px" Top="50px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true"
OnClientClose="closeRadWindow" />
</Windows>
</telerik:RadWindowManager>
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
if (e.Argument == "Rebind")
{
RadGrid1.MasterTableView.SortExpressions.Clear();
RadGrid1.MasterTableView.GroupByExpressions.Clear();
Presenter List = new Presenter(this);
IList<FileAdmin> GridDta = List.PopulateGrid();
RadGrid1.DataSource = GridDta;
RadGrid1.Rebind();
}
My javascript looks like this
function closeRadWindow()
{
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
function refreshGrid()
{
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
RadWindow aspx code Looks like this
javascript
function CloseAndRebind() {
GetRadWindow().BrowserWindow.refreshGrid();
//GetRadWindow().close();
}
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
Radwindow aspx.cs file looks like this
protected void buttonclick(object sender, EventArgs e)
{
if (result == true)
{
ClientScript.RegisterStartupScript(Page.GetType(), "mykey1", "CloseAndRebind();", true);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
修改 JavaScript closeRadWindow 方法,如下所示
Modify the JavaScript closeRadWindow method like mention bellow
我使用了与 tHARA_sOFT 使用的非常相似的方法...
这使我将 Rebind 和 RebindAndNavigate 合而为一。所有基于 Javascript 的...
I used a very similar method to what tHARA_sOFT used...
That gives me the Rebind, and RebindAndNavigate, rolled into one. All Javascript based...