Testing

@model List<amar.viewmodels.tachelienviewmodel>

@using Syncfusion.EJ2

<link rel="stylesheet" rel='nofollow' href="https://cdn.syncfusion.com/ej2/28.2.12/fluent.css">





<div class="ganttContainer">

@Html.EJS().Gantt("Gantt").DataSource(

(IEnumerable<object>)Model).Height(

"700px").Width(

"100%").EditSettings(edit =&gt;

{

edit.AllowEditing(true);

edit.AllowTaskbarEditing(true);

}).AllowParentDependency(

true).AllowResizing(

true).AllowTaskbarDragAndDrop(

true).AllowSorting(

true).TaskFields(

ts =&gt; ts.Id(

"TaskId").Name(

"TaskName").StartDate(

"StartDate").EndDate(

"EndDate").Duration(

"Duration").Progress(

"Progress").Dependency(

"Predecessor").Child(

"SubTasks")).Columns(col =&gt;

{

col.Field("OrdreLien").Width(50).Add();

col.Field("OrdreGamme").Width(50).Add();

col.Field("StartDate").Width(100).Add();

col.Field("TaskId").Width(50).Add();

col.Field("TaskPredName").Width(0).Add();

col.Field("TaskName").Width(250).Add();

col.Field("TaskSuccName").Width(0).Add();

}).WorkWeek(new string[] { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" }).SortSettings(

ss =&gt; ss.Columns(col =&gt;

{

col.Field("StartDate").Direction(Syncfusion.EJ2.Gantt.SortDirection.Ascending).Add();

})).SplitterSettings(ss =&gt; ss.Position("50%")).Render()





@Html.EJS().ScriptManager()



here's my ajax call (including the 100%width :



$.ajax({

url: configLIST.urlGammeLiens,

data: {

gammeId: gammeId

},

type: 'POST',

cache: false,

success: function (partial) {

$('#prep-body-container').html(partial);

$('.e-gantt-splitter').addClass('autoWidth')

$('#prep-modal').modal('show');

//eval(document.getElementById('prep-body-container').querySelector('script').innerHTML);

}

});



thank you for your time !
</object></div></amar.viewmodels.tachelienviewmodel>


2 Replies

PD Pravinkumar Dhanaraman Syncfusion Team July 21, 2025 07:05 AM UTC

default.aspx

<div id="divImage" runat="Server" />

default.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
 // There will be list of ids that has assing images. 
  divImage.InnerHtml = "<h3>Hello World</h3> <img src=\"<%= getData(id) %>\"";
}

public string getData(string id)
{
   return _client.GetImage(id); //"https://test.com/test-{id}.jpg";
}

Attachment: model_Listamar.viewmodels.tachelie_6df043fd.txt


PD Pravinkumar Dhanaraman Syncfusion Team July 21, 2025 07:14 AM UTC

$.ajax({
    url: configLIST.urlGammeLiens,
    data: {
        gammeId: gammeId
    },
    type: 'POST',
    cache: false,
    success: function (partial) {
        $('#prep-body-container').html(partial);
        $('.e-gantt-splitter').addClass('autoWidth');
        $('#prep-modal').modal('show');
        // Optional: eval(document.getElementById('prep-body-container').querySelector('script').innerHTML);
    }
});



Loader.
Up arrow icon