29th March 2016

DevExpress XtraReports - Add Clear Action To Dynamic Look Up List Parameters

DevExpress XtraReports - Add Clear Action To Dynamic Look Up List Parameters

Scenario

By default when adding a dynamic list look up parameter to an XtraReport at design time by assigning the parameter to your data source, when you rub the report and select a parameter there is then no way to clear the parameter field without having to close and reopen the report. We thought this wasn’t user friendly so after some research we found a solution to add a Clear action to each parameter to clear the selection within the parameter field.

 Solution

To add the Clear action to each parameter we had to create a script within the report to handle the Parameters Request Before Show event. Within the event we create an EditorButton and add it to the parameters LookUpEditor. We then impelement our EditorButtons OnClick event to clear the LookUpEditors EditValue and ItemIndex, which in turn clears and refreshes the parameter value.

Fill in this quick form and discover your digital future
Choose your interests:

Where to find us

We'd love to welcome you into our office! We're only 20 miles north of Peterborough, conveniently just off the A16.

Carver House
Apex Court, Elsoms Way
Pinchbeck
Lincolnshire
PE11 3UL