Show user-friendly description instead of a field value in the grid for a selector

In many cases it will be more usable to display a user-friendly description instead of a field value in the grid for a selector. To do that, firstly you should add DescriptionField for the corresponding selector definition in your DAC, and then either add SelectorMode to the selector definition, or add DisplayMode property to the aspx.

For example, before adding DisplayMode property, my grids contains just field values:

<px:PXGridColumn DataField="ProductOptionID" TextAlign="Left" Width="100px" CommitChanges="True" />

After I add DisplayMode=”Text”, a DescriptionField value is displayed instead of field value:

<px:PXGridColumn DataField="ProductOptionID" DisplayMode="Text" TextAlign="Left" Width="100px" CommitChanges="True" />

The other supported values of the DisplayMode property are “Hint” (the column cell contains the value-description pair of the field) and “Value” (default value, the column cell contains the value of the field).

Happy coding!

1 Reply to “Show user-friendly description instead of a field value in the grid for a selector”

  1. I’m having trouble using DisplayModeText. The selector field does not commit changes when I clear the field, but if I use DisplayModeHint or DisplayModeValue, the field commits just fine after I clear it.
    Is there a workaround for this?
    I can’t use DisplayModeHint because it doesnt let the user copy the description text from the selector field when they select it, it only copies the value.

Leave a Reply

Your email address will not be published. Required fields are marked *