We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Read data dynamically

Thread ID:

Created:

Updated:

Platform:

Replies:

116404 May 20,2014 03:00 AM Jun 11,2014 03:30 AM JavaScript 3
loading
Tags: ejGantt
Otomar Naprstek
Asked On May 20, 2014 03:00 AM

Hello,

sorry for may bad english. My problem is follow: I need to read dynamically data for the ejGantt using c# public class. I tried it this way:

ascx file:

<script type="text/javascript">
    dataSource = "<%=GanttData%>";
    var datamanager = ej.DataManager(dataSource);
...

    $(function () {
        $("#Grid").ejGantt({
            dataSource: datamanager,
...
            }
});
    });
</script>


code behind file:

public VirtualizationData[] GanttData
{
get { return GetData(); }
}

public static VirtualizationData[] GetData()
{
List<VirtualizationData> list = new List<VirtualizationData>();
list.Add(new VirtualizationData()
{
Id = 1,
Name = "Task1",
PercentDone = 50,
StartDate = "01/17/2010",
Duration = 5
});

         return list.ToArray();
}

 public class VirtualizationData
{
public string StartDate { get; set; }
public int Id { get; set; }
public string Name { get; set; }
public int Duration { get; set; }
public int PercentDone { get; set; }
public VirtualizationData[] Children { get; set; }
public string Predescessor { get; set; }


But datamanager contains the 'Name' of data class instead data values.
       
What am I doing incorrectly ?

Thanks and BR
Oto

Bharath Marimuthu [Syncfusion]
Replied On May 21, 2014 05:54 AM

Hi Oto,

 

Sorry about the inconvenience caused.

 

We have analyzed the provided code snippet but we are unable to understand your requirement. Since we don’t have the dataManager support in our ejGantt control but you have tried to use ej.DataManager. So could you please share us your sample or more details related to this query to explain the working scenario? This would be very helpful for us to serve you to provide a proper solution.

 

Please let me know if you require further assistance on this.

 

Thanks,

Bharath 


Otomar Naprstek
Replied On June 10, 2014 04:29 AM

I found the solution:

ascx file:

<script type="text/javascript">
    var data = "<%=GanttData%>";
...

    $(function () {
        $("#Grid").ejGantt({
            dataSource: data,
...
            }
});
    });
</script>

code behind file:

public VirtualizationData[] GanttData
{
        JavaScriptSerializer serializer = new JavaScriptSerializer();
get { return serializer.Serialize(GetData()); }
}

And now the data vlaues are comming.

BR
Oto

Bharath Marimuthu [Syncfusion]
Replied On June 11, 2014 03:30 AM

Hi Otomar ,

 

Thanks for your update .

 

We are glad to know that your issue has been resolved . Please let us know if you require any further assistance on this.

 

Regards,

Bharath.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;