Skip to content

DxDataGrid Lookup Column Clear

When you don’t want to define a new lookup value (None, Other etc. ) for the null or empty selection while editing, you can use the given approach as well to clear the lookup column (during the edit operation):

          onEditorPreparing: function (e) {
                    if (e.parentType === "dataRow") {
                        if (e.dataField === "REASON_TYPE_ID") {
                            e.editorOptions.showClearButton = true;
                        }
                     }
          },

As a result, a clear button is displayed (“x”) to clear the previously selected value like below:

Resource:

https://js.devexpress.com/Documentation/19_2/ApiReference/UI_Widgets/dxDataGrid/Configuration/columns/lookup/#allowClearing

That’s it, wishing you a great day!

Published inUncategorized

Comments are closed.