Load different data into Grid column ( DropDownButton)

Hello,

I have a column where I render, a DropDownButton. My question is, can I somehow change the content of the DropDownButton based on another column data? Let's say I have a column status. If status equal with done, I want the DropDownButton to be rendered with some items, if status is pending I want in the row with the DropDownButton to be rendered with another items. How I can achieve that? I tried to take a reference to the DropDownButton and after that add items in list, but the reference is pointing always on the first row of the Grid.

That is my html with the column that contains DropDownButton

            <e-column field='viewdetails' headerText='Vezi detalii' textAlign='Right' width=120>
                <ng-template #template let-gridData>
                    <div>
                        <button #dropdownbutton ejs-dropdownbutton [items]='items' (click)="dropDownButtonClick($event)" (beforeItemRender)="itemRender($event)" (select)="dropDownButtonItemSelected($event)" cssClass='e-round-corner' class="btn btn-info"></button>
                    </div>
                </ng-template>
            </e-column>

I want the 'items' to be changed based on another column value. I don't want all the DropDownButtons to have the same content, thanks!


1 Reply

PS Pavithra Subramaniyam Syncfusion Team March 21, 2022 01:53 PM UTC

Hi Robert, 
 
Thanks for contacting Syncfusion support. 
 
You can achieve your requirement by setting the items as the below code example. 
 
 
<ng-template #template let-gridData> 
          <div> 
            <button 
              #dropdownbutton 
              ejs-dropdownbutton 
              content="Clipboard" 
              [items]="gridData.Verified ? trueItems : falseItems" 
              cssClass="e-round-corner" 
              class="btn btn-info" 
            ></button> 
          </div> 
        </ng-template> 
 
 
 
 
Please get back to us if you need further assistance on this. 
 
Regards, 
Pavithra S 


Loader.
Up arrow icon