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

Resetting RadAjaxTimer by ajaxified radgrid

1 Answer 58 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Taeho Yoo
Top achievements
Rank 1
Taeho Yoo asked on 16 Nov 2009, 07:23 AM
Hi I am using RadControls for ASP.NET Q3 2007
I would like to reset (stop and star) a timer whenever any server events (update, insert, cancel delete etc) for a grid take place.
My code is

<radA:RadAjaxManager ID="RadAjaxManager1" runat="server">    
    <AjaxSettings>    
        <radA:AjaxSetting AjaxControlID="ClassUnlockTimer">    
            <UpdatedControls>    
                <radA:AjaxUpdatedControl ControlID="ClassUnlockTimer"/>    
            </UpdatedControls>    
        </radA:AjaxSetting> 
        <radA:AjaxSetting AjaxControlID="RadGrid1">    
            <UpdatedControls>    
                <radA:AjaxUpdatedControl ControlID="ClassUnlockTimer"/>    
            </UpdatedControls>    
        </radA:AjaxSetting> 
    </AjaxSettings>    
</radA:RadAjaxManager>    
 
 
<radA:RadAjaxTimer runat="server" ID="ClassUnlockTimer" AutoStart="false" /> 
<radG:RadGrid ID="RadGrid1" runat="server"  EnableAJAX="True"....  
 

protected void Page_Init(object sender, System.EventArgs e)  
    {  
        ClassUnlockTimer.Tick += new RadAjaxTimer.TickDelegate(timer_Tick);  
        ClassUnlockTimer.Interval = 40000;  
        ClassUnlockTimer.Stop();  
        ClassUnlockTimer.Start();  
    } 

it doesn't restart the timer somehow.
Am I missing something here??

Thanks

Toby

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 19 Nov 2009, 08:12 AM
Hi Taeho,

In order to achieve your goal I suggest that you handle the grid ItemCommand event. There when the CommandName is Edit or InitInsert you should stop the timer and tart it back on Update, PerformInsert and Cancel commands.

Check it out and let me know if you need further directions.

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
Taeho Yoo
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or