OnTaskInsert and OnTaskUpdate

4 posts, 0 answers
  1. Olivier
    Olivier avatar
    146 posts
    Member since:
    Nov 2010

    Posted 08 Sep 2014 Link to this post

    Hello,

    I would to understand , how i can save in my database a new task on a Event

    When i use OnTaskInsert

    How it's work  , there are no documentation ?

    How this event it's Fire ?

    thanks Olivier

    protected void RadGantt1_TaskInsert(object sender, Telerik.Web.UI.Gantt.GanttEventArgs e)
           {
               foreach (var item in e.Tasks)
               {
                   this.oGanttTacheBo.title =  item.Title;
                   this.oGanttTacheBo.parentid = item.ParentID;
                   this.oGanttTacheBo.OrderID = item.OrderID;
                   this.oGanttTacheBo.start = item.Start;
                   this.oGanttTacheBo.end = item.End;
                   this.oGanttTacheBo.PercentComplete = item.PercentComplete;
                   this.oGanttTacheBo.Expanded = item.Expanded;
     
                   // Here i can save in my database or i make a sql script ?
                  // How this event it's FIRE ?
                       this.oGanttTacheBo.Save();
     
     
               }
           }


    protected void RadGantt1_TaskInsert(object sender, Telerik.Web.UI.Gantt.GanttEventArgs e)
            {
                foreach (var item in e.Tasks)
                {
                    item.Title = "Nouvelle tache "+DateTime.Now.ToString();
                    item.ParentID = null;
                    item.OrderID = 10;
                    item.Start = DateTime.Now;
                    item.End = DateTime.Now.AddDays(1);
                    item.PercentComplete = Convert.ToDecimal("0,2");
                    item.Expanded = false;
                    item.Summary = false;
                    //Response.Write(item.Start);
                    /*try{
                        this.oGanttTacheBo.Add();
                        this.oGanttTacheBo.gat_parent_id    = Convert.ToInt32(item.ParentID);
                        this.oGanttTacheBo.gat_order_id     = Convert.ToInt32(item.OrderID);
                        this.oGanttTacheBo.gat_title        = item.Title;
                        this.oGanttTacheBo.gat_start        = item.Start;
                        this.oGanttTacheBo.gat_end          = item.End;
                        this.oGanttTacheBo.gat_avancement   = item.PercentComplete;
                        this.oGanttTacheBo.gat_expanded     = item.Expanded;
                        this.oGanttTacheBo.gat_summary      = item.Summary;

                        this.oGanttTacheBo.Save();
                    }catch (Exception ex) {
                        //Response.Write(ex.Message);
                        BusinessLayer.TransactionRollback("");
                    }*/

                    //Response.Write("tache ajoutée");
                }
            }
  2. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 09 Sep 2014 Link to this post

    Hello,

    With the official Beta release of the Gantt there were some problems with the Server events, due to the fact that they were triggered during a callback phase, instead of a full postback. This has since been fixed, and if you download the latest internal build you will be able to use the events to implement your databse operations. I've attached a sample page where such approach is demonstrated.

    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Olivier
    Olivier avatar
    146 posts
    Member since:
    Nov 2010

    Posted 09 Sep 2014 in reply to Bozhidar Link to this post

    Hello Bozhidar

    Thanks for your reply ,  i have a Telerik Version v2014.2.724.45, you suggest me to download a beta version ?

    thanks
    Olivier,
  5. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 09 Sep 2014 Link to this post

    Hello Oliver,

    The version you are using is the ServicePack to the Q2 release, however the fixes were implemented after it was released. So in order to test the new functionality, you have to either download the latest internal build, or wait for the Q3 Beta release which is scheduled for the 1st of October.

    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top