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

OnTaskInsert and OnTaskUpdate

3 Answers 77 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Olivier
Top achievements
Rank 2
Olivier asked on 08 Sep 2014, 05:50 PM
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");
            }
        }

3 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 09 Sep 2014, 08:16 AM
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.

 
0
Olivier
Top achievements
Rank 2
answered on 09 Sep 2014, 08:41 AM
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,
0
Bozhidar
Telerik team
answered on 09 Sep 2014, 10:20 AM
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.

 
Tags
Gantt
Asked by
Olivier
Top achievements
Rank 2
Answers by
Bozhidar
Telerik team
Olivier
Top achievements
Rank 2
Share this question
or