When using TreeList widget with a simple model like this:
public class MyModel
{
public int? Id {get;set;}
public int? ParentId {get;set;}
public string Name {get;set;}
}
...
@(Html.Kendo().TreeList<MyModel>().Name("treeList")
.Toolbar(t=>t.Create())
.Editable(e=>e.Mode("popup"))
.DataSource(ds=>ds
.Model(m=>
{
m.Id(f=>f.Id);
m.ParentId(f=>f.ParentId);
m.Field(f=>f.Name);
})
.Create(c=>c.Action("Create", "My"))
)
.Columns(c=>
{
c.Add().Field(f=>f.Id);
c.Add().Field(f=>f.ParentId)
c.Add().Field(f=>f.Name)
})
)
When filling the popup, there are no error, but the item is NOT inserted in the treeList. If I change the type of the Id and ParentId to non nullable, the problem is solved.
In your demo, the model seems to have nullable fields as Id and ParentId, but there are no demo of item creation. Is it a bug or something missing in my code?When using TreeList widget with a simple model like this:
public class MyModel
{
public int? Id {get;set;}
public int? ParentId {get;set;}
public string Name {get;set;}
}
...
@(Html.Kendo().TreeList<MyModel>().Name("treeList")
.Toolbar(t=>t.Create())
.Editable(e=>e.Mode("popup"))
.DataSource(ds=>ds
.Model(m=>
{
m.Id(f=>f.Id);
m.ParentId(f=>f.ParentId);
m.Field(f=>f.Name);
})
.Create(c=>c.Action("Create", "My"))
)
.Columns(c=>
{
c.Add().Field(f=>f.Id);
c.Add().Field(f=>f.ParentId)
c.Add().Field(f=>f.Name)
})
)
When filling the popup, there are no error, but the item is NOT inserted in the treeList. If I change the type of the Id and ParentId to non nullable, the problem is solved.
In your demo, the model seems to have nullable fields as Id and ParentId, but there are no demo of item creation. Is it a bug or something missing in my code?
Regards