More in this section

Forums / Developing with Sitefinity / custome module

custome module

1 posts, 0 answered
  1. Monika
    Monika avatar
    2 posts
    Registered:
    31 Jan 2012
    14 Mar 2012
    Link to this post
    hi. i m working the custome module
     i have some filed in that like city,country,albumid
     and need to populate the dropdown with
    city and country
     DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
                         Type clpropertyType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.CL_Property.clproperty");
                     
                         // This is how we get the collection of CLProperty items
                          var myFilteredCollection = dynamicModuleManager.GetDataItems(clpropertyType).Where("Country = "+drpcountry .SelectedItem .Text +"");
                         // for new xml category R&d

                    if (myFilteredCollection != null)
                    {
                      
                       
                            drpcountry.DataSource =myFilteredCollection;
                             drpcountry .DataTextField="City";
                             drpcountry .DataValueField="City";

                             drpcountry .DataBind ();
                     

                        drpsitefintycity.Items.Insert(0, new ListItem("--Select--", "0"));
                    }


     2 nd need to fatch filter further smthing like this for search result
     DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
                      Type clpropertyType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.CL_Property.clproperty");
                    
                         // This is how we get the collection of CLProperty items
                         var myFilteredCollection = dynamicModuleManager.GetDataItems(clpropertyType).Where("Country = "+drpcountry .SelectedItem .Text +"").Where("City = "+drpsitefintycity .SelectedItem .Text +"");
                         // for new xml category R&d
                    
                             if (myFilteredCollection != null)
                             {
                                          foreach ( Telerik.Sitefinity.DynamicModules.Model .DynamicContent  v in myFilteredCollection)
                                          {
                                            string albumID= v.GetValue("AlbumId").ToString ();
    }
    }

    i get the error please   check , and pease check if this is the way to put 2 where clause(2 filter).
    please reply ASAP


1 posts, 0 answered