Hi Kalum,
We have checked your reported problem with your provided code block. We suspect that you may missed to define the Expanded mapping field values in data source. Could you please ensure this at your end?
|
[Model]
public class TreeModel
{
public int BUKey { get; set; }
public int PrntBUKey { get; set; }
public string BUName { get; set; }
public bool expanded { get; set; }
}
[DataSource]
List<TreeModel> griddata = new List<TreeModel>();
griddata.Add(new TreeModel { BUKey = 1, PrntBUKey = 0, BUName = "Item 1", expanded = true });
griddata.Add(new TreeModel { BUKey = 2, PrntBUKey = 0, BUName = "Item 2", expanded = true }); |
For your requirement, we have prepared a sample, please find the sample in below location.
Sample Link:
To know more details about Populate data in TreeView component, please check the following help document.
Please let us know, if the provided information’s are helpful to resolve your problem or not.
Regards,
Ashokkumar B.