Devextreme, dxLookup, get the value of a selected row

0
0

Hi,

How do I get the value of the selected row in a dxLooukup widget?
The code below does not work.

Dim retValue = dxLookup1.Eval("this.widget.option('value')")

Thanks,
Per

  • You must to post comments
0
0

Excellent, Julie!

That worked perfectly. Thank you!

  • You must to post comments
0
0
  1. You can attach to the onSelectionChanged event like so:
    dxLookup1.Instance.onSelectionChanged += new WidgetEventHandler(this.dxLookup1_onSelectionChanged);private void dxLookup1_onSelectionChanged(object sender, WidgetEventArgs e)
    {
    AlertBox.Show(e.Data.ToJSON());

    }
  2. You can use optionAsync to get the value: (must be async because we expect a value back.)
    int value = await dxLookup1.Instance.optionAsync("value");
    AlertBox.Show(value.ToString());
  3. If you want to change the selected value via code, you can do it like so: (where 2 is the new value to be set)
    dxLookup1.Instance.option("value", 2);

See attached sample.

Attachment
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.