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 embedded tree grid in dialog

hi expert,

How to embedded tree grid in dialog

<div id="dialog" class="custom-template"></div>
        <div id="dlgContent" style="visibility: hidden" class="dialogContent">
            <div id ="treegrid1"></div>

While using above,some time the tree grid table not displaying within dialog. 

Thanks and Regards

1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team November 22, 2019 04:27 PM UTC

Hi Sarathkumar, 

Thanks for contacting Syncfusion Support. 

We have checked your query and we can render the TreeGrid inside the Dialog component. We can render the TreeGrid using open event of the Dialog and using placed the TreeGrid on the content property of the Dialog. 

Please refer to the code example:- 

<div id="defaultDialog"> 


    let treegrid: TreeGrid = new TreeGrid( 
            dataSource: sampleData, 
            childMapping: 'subtasks', 
            treeColumnIndex: 1, 
            allowPaging: true, 
            height: 500, 
            columns: [ 
                { field: 'taskID', headerText: 'Task ID', width: 70, textAlign: 'Right' }, 
                { field: 'taskName', headerText: 'Task Name', width: 200, textAlign: 'Left' }, 

let dialogObj: Dialog = new Dialog({ 
        header: 'About SYNCFUSION Tree grid inside Dialog', 
        target: document.getElementById('target'), 
        content: "<div id='TreeGrid'></div>", 
        animationSettings: { effect: 'None' }, 
        showCloseIcon: true, 
        width: '800px', 
        height: '600px', 
        open: dialogOpen, 

    // 'Open' Button will be hidden, if Dialog is opened 
    function dialogOpen(): void { 
        //document.getElementById('dialogBtn').style.display = 'none'; 

Please get back to us if you need any further assistance. 

Farveen sulthana T 

Live Chat Icon For mobile
Up arrow icon