1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Filter Customer Module by Multiple Form Values (DatePicker, Yes/No & Like Search)

Filter Customer Module by Multiple Form Values (DatePicker, Yes/No & Like Search)

1 posts, 0 answered
  1. Matt
    Matt avatar
    35 posts
    Registered:
    01 Nov 2010
    31 Jul 2012
    Link to this post
    I created a custom module made up of about 6 fields.  First Name, Last Name, Company, Gender, Active and Date of Birth.  I would like to filter based on values submitted by a form but I'm not sure how to handle multiple values.  I can get it to work if I hard code some values but I'm not sure who to do it dynamically.  Plus how do you handle blank form values or date ranges.   I would like to be able to search with a like value instead of equals and when it comes to date field, I'd like to be able to search by greater than and less than.
    Type contactType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Contacts.Contact");              
               var myCollection = dynamicModuleManager.GetDataItems(contactType).Where("Active == true").Where(i => i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && i.Visible == true);
                   //&& i.GetValue<string>("Company")==Company.Text
                   //&& i.GetValue<string>("Gender")==Gender.Text
               return myCollection;

1 posts, 0 answered