This is a migrated thread and some comments may be shown as answers.

[Solved] Page reload after add appointment

5 Answers 207 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Stev
Top achievements
Rank 1
Stev asked on 11 Jun 2009, 03:16 PM

hallo, 

how can i reload the page after i insert or add appointment in scheduler ?

i have tried with : OnAppointmentInsert="insertUpdate"

 protected void insertUpdate(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e)
{
Response.Redirect("Action.aspx");
}

Action.aspx is the page that contain Scheduler.

i have tried also with OnAppointmentCreated...but all not work.

thanx in before,

Stev

5 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 12 Jun 2009, 08:36 AM
Hi Stev,

I guess Response.Redirect does not work because you ajaxify the scheduler.
Is that the case?

If yes, you can use the Redirect method of RadAjaxManager object:

protected void insertUpdate(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e) 
   RadAjaxManager1.Redirect("Action.aspx"); 

Let us know if this work.

All the best,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stev
Top achievements
Rank 1
answered on 12 Jun 2009, 09:55 AM
thanx you for your response, i have found myself the solution with this

protected void insertUpdate(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e)    
{    
   Response.AppendHeader("REFRESH""1;URL=Action.aspx");  
}    
 

but i think it is not a good solution, because it refresh the page 2 times.
1.after i do insert on my scheduler
2.with function insertUpdate.

in fact, my scheduler and my gridview on the same file --> action.aspx and both of them connect with the same table in my database.

i wanna to make with 1 refresh or AJAX, everytime  INSERT/UPDATE/DELETE my appointment, it change automaticaly in my gridview and vice versa ?

Thanx in advance,
Stev

PS: btw your radScript manager NOT WORK, instead of that i have to use 

<

 

asp:ScriptManager ID="ScriptManager1" runat="server">

 

 

</asp:ScriptManager>

 


0
Veselin Vasilev
Telerik team
answered on 12 Jun 2009, 10:47 AM
Hello Stev,

We have an online demo which shows the integration between RadGrid and RadScheduler and RadScriptmanager. Everything is working as expected there.

Regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stev
Top achievements
Rank 1
answered on 12 Jun 2009, 01:29 PM
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
          
        <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadScheduler1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
          
          
        <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="EndTime"   
            OnAppointmentCommand="RadScheduler1_refressh" 
            DataKeyField="NO_ACTION_FICTIF" DataRecurrenceField="RecurrenceRule"   
            DataRecurrenceParentKeyField="RecurrenceParentID"   
            DataSourceID="LinqDataSource1" DataStartField="StarTime"   
            DataSubjectField="COMPTE_ACT" Height="" HoursPanelTimeFormat="htt"   
            ValidationGroup="RadScheduler1">  
        </telerik:RadScheduler> 
        <asp:LinqDataSource ID="LinqDataSource1" runat="server"   
            ContextTypeName="DataClassesDataContext" EnableDelete="True"   
            EnableInsert="True" EnableUpdate="True" TableName="ACTION_FICTIF">  
        </asp:LinqDataSource> 
          
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"   
            AllowPaging="True" AllowSorting="True" GridLines="None" ShowGroupPanel="True">  
<HeaderContextMenu> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</HeaderContextMenu> 
 
<MasterTableView> 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
</MasterTableView> 
 
            <ClientSettings AllowDragToGroup="True">  
                <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
            </ClientSettings> 
 
<FilterMenu> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
        </telerik:RadGrid> 
          
    </div> 
    </form> 
</body> 
</html> 
 

and my cs

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
 
public partial class _Default : System.Web.UI.Page   
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        DataClassesDataContext temp = new DataClassesDataContext();  
 
        var ret = from goi in temp.ACTION_FICTIF  
                  select new 
                  {  
                      NoAction = goi.NO_ACTION_FICTIF,  
                      Libelle = goi.COMPTE_ACT,  
                      Acteur = goi.COD_COM,  
 
                      HeureDébut = goi.StarTime,  
                      HeureFin = goi.EndTime  
 
                  };  
 
        RadGrid1.DataSource = ret;  
        RadGrid1.DataBind();  
    }  
    protected void RadScheduler1_refressh(object sender, Telerik.Web.UI.AppointmentCommandEventArgs e)  
    {  
        RadScheduler1.Rebind();  
        RadGrid1.Rebind();  
 
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadScheduler1, RadGrid1);  
    }  
}  
 

every time insert/modifie/delete in my scheduler, it not synchrone with my girdview, eventhough i have use Rebind() and ajax for not loading the whole page.
can you tell me what wrongs in my code?

thanx in advance,
Stev
0
Veselin Vasilev
Telerik team
answered on 17 Jun 2009, 01:10 PM
Hi Stev,

Maybe the problem is caused because you are databinding the grid in every page_load. Maybe it is better to do only if it is not postback.
Still, I believe the best way to proceed is to send us a sample running project (in a new support ticket) where we can debug the problem.

Greetings,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Stev
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Stev
Top achievements
Rank 1
Share this question
or