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. Image for the cookie policy date

How to add a row/record in TreeGrid with children?

I want to programatically add a new row in treegrid with children. But latest version doesn't have a addRow method and addRecord is not working as expected.
I tried adding a row using dataSource. That adds a row, but not with children. Please tell me a solution ASAP, its urgent.

1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team December 14, 2019 02:24 PM UTC

Hi Awais, 

Thanks for contacting Syncfusion Support. 

QUERY: Programmatically add new row with child in TreeGrid 

From your query we understand that you need to add both parent and child record programatically to TreeGrid. This can be achieved by using "dataSource" property of TreeGrid. 

Please check the below sample, 

In the above sample, we have added new record to Treegrid along with it's children in button click. When you click the button placed above the TreeGrid, new record will be added. 

If you have further queries, please get back to us. 

Regards, 
Farveen sulthana T 


Loader.
Live Chat Icon For mobile
Up arrow icon