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

How to use LocalizationPath property?

2 Answers 158 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Melvin
Top achievements
Rank 1
Melvin asked on 27 Aug 2015, 08:44 PM

Hello,

 I have a problem when I use the LocalizationPath, because these not taken the content that I define in my file resource. I´ve defined the gantt chart from code.

 Here my code C#

private void agregarColumna(string DataField, string Header, int tamano, RadGantt ctrlGantt)
{
    GanttBoundColumn gbc = new GanttBoundColumn();
    gbc.DataField = DataField;
    gbc.HeaderText = Header;
    gbc.Width = Unit.Pixel(tamano);
    ctrlGantt.Columns.Add(gbc);
}
 
private void CargarGraficoGantt(DataTable dtGantt)
{
    RadGantt rgGantt = new RadGantt();
    rgGantt.ID = "GraficoGantt";
    rgGantt.SnapToGrid = false;
    rgGantt.ReadOnly = true;
    rgGantt.AllowSorting = false;
    rgGantt.SelectedView = GanttViewType.MonthView;
    rgGantt.AutoGenerateColumns = false;
    rgGantt.EnableViewState = true;
    rgGantt.EnablePdfExport = true;

   rgGantt.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("es-ES");​

    //rgGantt.LocalizationPath = "App_LocalResources/";
    //rgGantt.Width = Unit.Percentage(100.0);
    //rgGantt.Height = Unit.Percentage(100.0);
    //Columnas
    agregarColumna("ID", "Id", 50, rgGantt);
    agregarColumna("Title", "Tareas a Desarrollar", 350, rgGantt);
    agregarColumna("PercentComplete", "Porcentaje", 80, rgGantt);
 
    rgGantt.DataBindings.TasksDataBindings.IdField = "ID";
    rgGantt.DataBindings.TasksDataBindings.TitleField = "Subject";
    rgGantt.DataBindings.TasksDataBindings.StartField = "Start";
    rgGantt.DataBindings.TasksDataBindings.EndField = "End";
    rgGantt.DataBindings.TasksDataBindings.ParentIdField = "ParentID";
    rgGantt.DataBindings.TasksDataBindings.SummaryField = "summary";
    rgGantt.DataBindings.TasksDataBindings.PercentCompleteField = "PercentComplete";
 
    rgGantt.DataSource = dtGantt;
    rgGantt.Skin = "Bootstrap";
    rgGantt.DataBind();
     
    divGantt.Controls.Add(rgGantt);
}
 
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        DataTable tasks = new DataTable();
        tasks.Columns.Add(new DataColumn("ID", typeof(int)));
        tasks.Columns.Add(new DataColumn("ParentID", typeof(int)));
        tasks.Columns.Add(new DataColumn("Subject", typeof(string)));
        tasks.Columns.Add(new DataColumn("Summary", typeof(bool)));
        tasks.Columns.Add(new DataColumn("PercentComplete", typeof(decimal)));
        tasks.Columns.Add(new DataColumn("Start", typeof(DateTime)));
        tasks.Columns.Add(new DataColumn("End", typeof(DateTime)));
 
        tasks.Rows.Add(1, null, "Defining selection", false, 0.1, new DateTime(2015, 8, 2), new DateTime(2015, 9, 4));
        tasks.Rows.Add(2, null, "Researching the market for candidates", true, 0, new DateTime(2015, 8, 3), new DateTime(2015, 8, 15));
        tasks.Rows.Add(3, 2, "Advertising the position", false, 0.3, new DateTime(2015, 8, 10), new DateTime(2015, 8, 15));
        tasks.Rows.Add(4, 2, "Collecting job applications", false, 0.5, new DateTime(2015, 8, 10), new DateTime(2015, 8, 15));
        tasks.Rows.Add(5, null, "Categorizing applications", false, 0.5, new DateTime(2015, 8, 17), new DateTime(2015, 8, 22));
        tasks.Rows.Add(6, null, "Assessing applicants", true, 0, new DateTime(2015, 8, 19), new DateTime(2015, 8, 31));
        tasks.Rows.Add(7, 6, "Interview with Human Resources representatives", false, 0.2, new DateTime(2015, 8, 24), new DateTime(2015, 8, 26));
        tasks.Rows.Add(8, 6, "Asigning and reviewing a sample test task", false, 0.2, new DateTime(2015, 8, 24), new DateTime(2015, 8, 27));
        tasks.Rows.Add(9, 6, "Interview with Development representatives", false, 0.6, new DateTime(2015, 8, 26), new DateTime(2015, 8, 28));
        tasks.Rows.Add(10, null, "Creating and proposing the job offer", false, 0.7, new DateTime(2015, 8, 27), new DateTime(2015, 8, 29));
        tasks.Rows.Add(11, null, "Hiring applicant", false, 0.4, new DateTime(2015, 8, 25), new DateTime(2015, 8, 31));
 
        rgDemo.DataSource = tasks;
        rgDemo.AutoGenerateColumns = true;
        rgDemo.Skin = "Bootstrap";
        rgDemo.MasterTableView.DataKeyNames = new string[] {"ID"};
        //Gant
        this.CargarGraficoGantt(tasks);
    }
}

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfDemo.aspx.cs" Inherits="testTelerik.wfDemo" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI.Gantt" tagprefix="cc1" %>
 
<!DOCTYPE html>
 
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!--Grid-->
    <link href="css/Glow/Grid.Glow.css" rel="stylesheet" />
    <link href="css/Bootstrap/Grid.Bootstrap.css" rel="stylesheet" />
    <!--Gantt-->
    <link href="css/Glow/Ajax.Glow.css" rel="stylesheet" />
    <link href="css/Glow/Gantt.Glow.css" rel="stylesheet" />
    <link href="css/Glow/Input.Glow.css" rel="stylesheet" />
    <link href="css/Bootstrap/TabStrip.Bootstrap.css" rel="stylesheet" />
    <link href="css/Bootstrap/Input.Bootstrap.css" rel="stylesheet" />
    <link href="css/Bootstrap/Gantt.Bootstrap.css" rel="stylesheet" />
    <!--Scheduler-->
    <link href="css/Bootstrap/Calendar.Bootstrap.css" rel="stylesheet" />
    <link href="css/Bootstrap/Scheduler.Bootstrap.css" rel="stylesheet" />
    <link href="css/Bootstrap/SchedulerRecurrenceEditor.Bootstrap.css" rel="stylesheet" />
    <link href="css/Bootstrap/SchedulerReminderDialog.Bootstrap.css" rel="stylesheet" />
    <link href="css/Bootstrap/Window.Bootstrap.css" rel="stylesheet" />
    <link href="css/Bootstrap/Menu.Bootstrap.css" rel="stylesheet" />
    <title></title>
 
</head>
<body>
    <form id="form1" runat="server">
        <telerik:radscriptmanager runat="server"></telerik:radscriptmanager>
        <telerik:RadAjaxLoadingPanel ID="ralpGantt" runat="server" Skin="Glow"></telerik:RadAjaxLoadingPanel>
        <div class="container" id="divContenedor" runat="server">
            <ul class="nav nav-pills">
                <li class="active"><a data-toggle="tab" href="#divGrid">Grid</a></li>
                <li><a data-toggle="tab" href="#divGantt">Gantt</a></li>
            </ul>
            <div class="tab-content">
                <div id="divGrid" class="tab-pane fade" runat="server">
                    <telerik:radgrid ID="rgDemo" runat="server"></telerik:radgrid>
                </div>
                <div id="divGantt" runat="server" class="tab-pane fade in active">
                     
                </div>
            </div>
        </div>
        <telerik:radcodeblock runat="server">
            <script src="jquery.loadmask.js"></script>
            <script src="bootstrap-remote-tabs.js"></script>
        </telerik:radcodeblock>
    </form>
</body>
</html>
 

 But if I enabled this line

 

rgGantt.LocalizationPath = "App_LocalResources/";

The content gantt chart does not shows.

What is wrong in my code?

 

 

 

 

 

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Aneliya Petkova
Telerik team
answered on 28 Aug 2015, 08:37 AM
Hi Melvin,

I tested the code you sent, and everything works as expected at my side. Attached you may find the project I tested with(see Default.aspx).

Please note that the RadGantt control relies on RadGantt.resx file, not RadGantt.Main.resx and if you are using es-ES culture, the resx file must be named RadGantt.es-ES.resx.

Hope this will be helpful.


Regards,
Aneliya Petkova
Telerik
0
Melvin
Top achievements
Rank 1
answered on 28 Aug 2015, 01:54 PM
Ok, thanks for your answer
Tags
Gantt
Asked by
Melvin
Top achievements
Rank 1
Answers by
Aneliya Petkova
Telerik team
Melvin
Top achievements
Rank 1
Share this question
or