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

TreeGrid DropDown columns

Hello,

I have some columns configured as TreeGridEditingType.Dropdown, and I have set DropDownData property with the values of the dropdown editor, but the cells don't show the text property, only the value property.

Thanks!

1 Reply

MK Mahalakshmi Karthikeyan Syncfusion Team November 24, 2015 12:49 PM UTC

Hi Jorge,

Thanks for contacting Syncfusion support.

Currently TreeGrid renders the value field of the dropdown data in the dropdown column. But we can display the text field of the drop down data using “QueryCellInfo” client side event. Please refer the below code example below,

<head id="Head1" runat="server">

<script type="text/javascript">

       function querycellinfo(args) {

           if (args.column.editType == "dropdownedit") {

               var prevValue = args.cellValue;

               for (i = 0; i < args.column.dropdownData.length; i++) {

                   if (prevValue == args.column.dropdownData[i].value)

                       $(args.cellElement).text(args.column.dropdownData[i].text);

               }

           }

       }

   </script>

</head>

  

<body>    


    <form id="form1">

          <ej:treegrid ID="Treegrid" runat="server"  AllowColumnResize="true"

          //...

                QueryCellInfo="querycellinfo" EndEdit="endEdit">

          </ej:treegrid>         

    </form>

</body>

We have also prepared a sample based on this and you can find the sample under the following location:

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/dropdown854688664

And we have also logged an issue report regarding this. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let us know if you require further assistance on this.      

Regards,

Mahalakshmi K.


Loader.
Up arrow icon