show drop down in grid in dialogue and fill data

Hi,
when i click on add button in tool bar of grid, a dialogue opens i want to show a column of grid as dropdown into it also want to fill data into it. Please share example for this.
I found example for the grid edit cell but mine is dialogue.

Thanks

3 Replies

MS Manivel Sellamuthu Syncfusion Team April 1, 2020 05:28 AM UTC

Hi Rakhi, 

Greetings from Syncfusion support. 

You can achieve your requirement by mentioning editType for a column as ‘dropdownedit’. Please find the below code example and documentation link for more information. 

    <ejs-grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'> 
        <e-columns> 
             
<e-column field='ShipCountry' headerText='Ship Country' width='150' editType='dropdownedit'></e-column> 
        </e-columns> 
    </ejs-grid> 




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

Regards, 
Manivel 



RA RakhiS replied to Manivel Sellamuthu April 3, 2020 05:12 AM UTC

Hi Rakhi, 

Greetings from Syncfusion support. 

You can achieve your requirement by mentioning editType for a column as ‘dropdownedit’. Please find the below code example and documentation link for more information. 

    <ejs-grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'> 
        <e-columns> 
             
<e-column field='ShipCountry' headerText='Ship Country' width='150' editType='dropdownedit'></e-column> 
        </e-columns> 
    </ejs-grid> 




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

Regards, 
Manivel 


In the shared example I am not able to get how they bind the shipcountry dropdown. 
Please help. even I searched in the data .ts file but I am not getting this field binding.


MS Manivel Sellamuthu Syncfusion Team April 6, 2020 10:31 AM UTC

Hi Rakhi, 

Thanks for your update. 

Query: In the shared example I am not able to get how they bind the shipcountry dropdown. 
 
In EJ2Grid we already have built-in support for some components to render while editing. When we mention the edit type as ‘dropdownedit’ the dropdown will be rendered from source-level. 

Query: but I am not getting this field binding. 
 
From your query we cannot clearly understand your requirement. But we suspect that you want to customize the dropdown properties, which can be done in two ways. 

1. Edit params – Define edit type as dropdown edit and modify the properties through column.edit.params. Please refer the below link for more information. 
 
 
2. Cell Edit template: Using cell edit template, we can render the dropdown using write function column.edit. Here we can render the dropdown and customize it’s properties. 
 

If the above does not meet your requirement or this is not your exact requirement, please explain clearly about your requirement. 

Regards, 
Manivel 


Loader.
Up arrow icon