This is a migrated thread and some comments may be shown as answers.

Kendo Grid Inline Editing

1 Answer 520 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jiyo
Top achievements
Rank 2
Jiyo asked on 14 Nov 2019, 09:06 AM

Im using kendo grid inline editing and one of the field is a Dropdown and i'm able to bind the options inside Dropdown but my problem is i need to pass the id of selected option rather than its name....So how can i achieve that??? Here is my code....

 

<DropDownList
          style={{ width: "100px" }}
          onChange={this.handleChange.bind(this)}
          value={value}
          data={this.state.DataSet1.map(item => item.name)}
        />

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Nov 2019, 07:27 AM

Hello, Jiyo,

Please take a look at our custom editor demo:

https://www.telerik.com/kendo-react-ui/components/grid/editing/editing-custom/

Inside the change event of the DropDownList, there is access to the object value found it e.target.value. This will allow you to pass the desired part of the value, either the id or the name:

   handleChange = (e) => {
        this.props.onChange({
            dataItem: this.props.dataItem,
            field: this.props.field,
            syntheticEvent: e.syntheticEvent,
            value: e.target.value.value
        });
    }

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Jiyo
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Share this question
or