Last post Oct 17, 2010 11:30 PM by afshinra
Sep 24, 2008 11:31 AM|noimed|LINK
I just wondered if it is possible to set up a filter on elements which populate the foreign key drop-down list in edit mode (so that not all elements from the column related by the foreign key are in the list, just the ones that comply with the filter)
Sep 24, 2008 12:42 PM|sjnaughton|LINK
I think you need to create you own ForeignKey FieldTemplate and then filter the drop down list accordingly.
Jun 16, 2010 09:38 AM|gerardo gala|LINK
I have a similar question.
The Foreign Key drop-down has over 3K records and the users want a text box next to the drop-down. As they enter data in the text box, the items in the drop-down get filtered with the LIKE query to get a managable number instead of 3K items.
This needs to happen in the Edit Mode only.
I have customized ForeignKey_Edit.ascx under the FieldTemplates folder already. And I'm able to show my customization under a certain Table and Foreign Key only. I just need to figure out the code to filter the contents of the drop-down.
Foreign key filter
Jun 16, 2010 10:07 AM|sjnaughton|LINK
Well depending on what you want try
Part 1 – The Read-Only Hierarchical Field Template or have a look at Rick Anderson article here
Improving the FK field display: Showing two fields in Foreign Key columns you could also look at the Old
Dynamic Data Futures VS2008 SP1 RTM which has an AutoComplete field template.
Custom Field Templates
Oct 16, 2010 08:37 AM|afshinra|LINK
Thank you sjnaughton,
I have this problem too , and I want to filter , foreignKey Filter Items and don't display all records
can you let me know how can I do this,
Oct 16, 2010 11:37 AM|sjnaughton|LINK
Hi Afshinra, how do you want to filter the items in the filter ddl?
Oct 16, 2010 11:36 PM|afshinra|LINK
let me describe my problem,
I want to display "Personel" entity for loggined user , but not all personel , the personels that I define them manager to logined user,
I dont know how to change list,
at know , the personel filter and personel foriengkey control in edit mode , both display all personels
I wrote a method in DataContext that returns the true resultes but I dont know how to set these controls DataSource to my method
Oct 17, 2010 10:34 AM|sjnaughton|LINK
Hi Afshinra, I would just write a custom filter for this see
Great series of Dynamic Data posts by Oleg Sych for more info on Filters.
Dynamic Data 4
Oct 17, 2010 11:30 PM|afshinra|LINK
thank you sjnaughton
I wrote some custom filters and use FilterUIHintAttribute in metadata and it works