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

Tree Grid Row Selected

Hi Syncfusion Team

I'm using the treegrid to load the data from database as per below code, can you help me if want to capture the value when perform the row selected on the tree grid then set to the input / model / textboxfor

<ej-tree-grid id="TreeGridContainer" datasource="ViewBag.datasource" child-mapping="Children" tree-column-index="1"
                                  allow-filtering="true" allow-sorting="true" begin-edit="BeginEdit" is-responsive="true">
                        <e-tree-grid-columns>
                            <e-tree-grid-column field="DiagnosisPartCode" header-text="Diagnosis Code" allow-filtering="true" edit-type="String" width=45 />
                            <e-tree-grid-column field="Text" header-text="Diagnosis Name" edit-type="String" filter-edit-type="String" />
                        </e-tree-grid-columns>
                        <e-tree-grid-size-settings width="100%" height="350px" />
                        <e-tree-grid-edit-settings allow-deleting="true"
                                                   allow-adding="true"
                                                   allow-editing="true"
                                                   edit-mode="CellEditing" />
                    </ej-tree-grid>

Appreciate for your support.

Thanks

1 Reply

JS Jonesherine Stephen Syncfusion Team July 12, 2017 05:59 PM UTC

Hi Haryzad, 
Thanks for contacting Syncfusion support. 
By using “rowSelected” client side event we can perform any custom actions during row selection in TreeGrid. 
Please find the code example below: 
<ej-tree-grid id="TreeGridContainer" row-selected="rowSelected"></ej-tree-grid> 
 
<script type="text/javascript"> 
    function rowSelected(args) { 
        //Here we can perform any actions during row selection 
        alert(JSON.stringify(args.data.item)); 
   } 
</script> 
We have also prepared the sample based on this, please find the sample from below location. 
 
Regards, 
Jone sherine P S 


Loader.
Up arrow icon