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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can not set selected value in dropdownlist in Grid

Thread ID:





147583 Sep 17,2019 09:15 AM UTC Sep 19,2019 06:04 AM UTC React - EJ 2 3
Tags: Grid
Ryosei Yawata
Asked On September 17, 2019 09:15 AM UTC


based on the article, I can add dropdownlist to grid.
However, nothing in the dropwdownlist in a dialog  is selected(just show placeholder), when opening dialog to edit.
Could you tell me how to select value based on selected row data value?

    const typeColl = [
      { select_name: 'text', input_type: 'text' },
      { select_name: 'select', input_type: 'select' },
      { select_name: 'date', input_type: 'date' },

    const typeParams = {
      create: () => {
        this.stateElem = document.createElement('input');
        return this.stateElem;
      destroy: () => {
      read: () => {
        return this.stateObj.value;
      write: (args) => {
        let dataIndex = typeColl.findIndex(e => e.input_type === args.rowData[args.column.filed]);

        this.stateObj = new DropDownList({
          dataSource: new DataManager(typeColl),
          enabled: true,
          fields: { value: 'input_type', text: 'select_name' },
          floatLabelType: 'Never',
          placeholder: 'Select a type',
          index: dataIndex

        <GridComponent id="personConfig" rowDropSettings={{ targetID: 'personConfig' }} rowDrop={this.arrangeConfig} dataSource={this.state.personExtra}  allowRowDragAndDrop={true}  editSettings={{ allowEditing: true, allowAdding: true, allowDeleting: true, mode: "Dialog", showDeleteConfirmDialog: true, newRowPosition: 'Bottom' }}
          toolbar={toolbarOptions} toolbarClick={this.toolbarClickHandler}
          height="500" width="900" selectionSettings={{ type: 'Single' }}
          <Inject services={[RowDD, Selection, Edit, Toolbar]} />
            <ColumnDirective field='order' isPrimaryKey={true} headerText='No' defaultValue={extraDefaultValue} allowEditing={false} width="50"></ColumnDirective>
            <ColumnDirective field='extra_name'  width="100"></ColumnDirective>
            <ColumnDirective field='input_type'  width="50" editType="dropdownedit" edit={typeParams} validationRules={{ required: true }}></ColumnDirective>

Pavithra Subramaniyam [Syncfusion]
Replied On September 18, 2019 05:53 AM UTC

Hi Ryosei, 
Thanks for contacting Syncfusion support. 
Query: Could you tell me how to select value based on selected row data value?. 
You can set the row data value for the edit dropdown by using the “value” property of dropdownlist. Please refer to the below code example, documentation link and sample link for more information. 
this.typeParams = { 
      create: () => { 
        this.stateElem = document.createElement('input'); 
        return this.stateElem; 
      destroy: () => { 
      read: () => { 
        return this.stateObj.value; 
      write: (args) => { 
        let dataIndex = this.typeColl.findIndex(e => e.input_type === args.rowData[args.column.filed]); 
        this.stateObj = new DropDownList({ 
          dataSource: new DataManager(this.typeColl), 
          enabled: true, 
          value: args.rowData[args.column.field], 
          fields: { value: 'input_type', text: 'select_name' }, 
          floatLabelType: 'Never', 
          placeholder: 'Select a type', 
          index: dataIndex 
Please g et back to us if you need any further assistance on this. 
Pavithra S. 

Ryosei Yawata
Replied On September 18, 2019 07:27 AM UTC

Hi Pavithra,

Thanks, a lot.It works now.


Pavithra Subramaniyam [Syncfusion]
Replied On September 19, 2019 06:04 AM UTC

Hi Ryosei, 
Thanks for your update. 

We are happy to hear that the provided solution is working. 

Please contact us if you need any further assistance. As always, we will be happy to assist you.  
Pavithra S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon