In particular: Customizing the EntityEditorWithPicker by Igor Kozlov and Customize EntityEditorWithPicker by Hrvoje Kušanić.
I needed to go one step further with my SimpleQueryControl, I needed to filter out users by only selecting those with a value set by a combobox on the page with the picker.
To do this I set the custom propery of the EntityEditorWithPicker, where AppPicker is the ApproverPickerEntityEditor and BusinessAreaPicker is the combobox:
ApproverPickerEntityEditor AppPicker = new ApproverPickerEntityEditor();
AppPicker.CustomProperty = BusinessAreaPicker.SelectedValue;
This CustomProperty is appended to the QueryString which is sent by the open-dialog client side javascript. So to access this we can examine the QueryString in the class that inherits from PickerDialog:
public class ApproverPickerDialog : PickerDialog
In the OnLoad event of this PickerDialog I inserted the following code:
protected override void OnLoad(EventArgs e)
{
ApproverQueryControl thisQC = (ApproverQueryControl)this.QueryControl;
thisQC.SelectedBusinessArea = this.Page.Request.QueryString["CustomProperty"];
base.OnLoad(e);
}
Where ApproverQueryControl is the class inheriting from SimpleQueryControl, it has a property SelectedBusinessArea which is used by the IssueQuery method to filter out users by the value selected in the BusinessAreaPicker on the form page.

2 comments:
Do you still have the full source code for this? I found the Hrvoje Ksanic code is no longer available. This would be very helpful in understanding this entity picker.
Thanks!
Hi John, this was a long time ago, I'll try to dig it out.
Post a Comment