Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

I'm trying to filter a BDC list and my filter returns multiple values. When the BDC list is filtered it filters based on the first item and then ignores the remaining values. Has anyone run into this and how did you resolve it?

#region ITransformableFilterValues Members

        public bool AllowAllValue
        {
            get { return true; }
        }

        public bool AllowEmptyValue
        {
            get { return true; }
        }

        public bool AllowMultipleValues
        {
            get { return true; }
        }

        public string ParameterName
        {
            get { return "Ejemplo"; }
        }

        public ReadOnlyCollection<string> ParameterValues
        {

            get
            {

                List<string> regions = new List<string>();
                SPListItemCollection coleccion;
                using (SPSite site = new SPSite(SPContext.Current.Web.Url))
                {
                    using (SPWeb web = site.OpenWeb())
                    {                      
                        web.AllowUnsafeUpdates = true;
                        web.Update();
                        SPList list = web.Lists["Categorias"];
                        SPQuery query= new SPQuery();
                        query.Query= "<Where><Contains><FieldRef Name='Tags'/><Value Type='Note'>" +                HttpContext.Current.Request.Params.Get(0).ToString() + "</Value></Contains></Where>";

                        coleccion= list.GetItems(query);//this is the CAML query

                        debugger.Text = debugger.Text + "Items encontrados:" + coleccion.Count + "<br>" ;                                      
                        int i=0;                       
                        foreach (SPItem item in coleccion)//all the items i want i get them
                        {
                            try
                            {
                                regions.Add(item["Title"].ToString());
                                debugger.Text = debugger.Text + item["Title"].ToString() + "<br>";
                                i++;
                            }
                            catch (Exception ex)
                            {
                                debugger.Text = debugger.Text + item["Title"] + " Excepcion : values[" + i + "]" ;
                                i++;
                            }
                        }                                                         
                    }
                }
                ReadOnlyCollection<string> result = new ReadOnlyCollection<string>(regions);//i add the values to the collection to filter
                return result;

            }    
        }

        [ConnectionProvider("Filtro de ejemplos", "ITransformableFilterValues", AllowsMultipleConnections = true)]
        public ITransformableFilterValues SetConnection()
        {
            return this;
        }

    #endregion
share|improve this question
1  
I have the same problem when filtering a document library. Only ParameterValues[0] is used to filter, although I set AllowMultipleValues to true. Did you find something new on this? – Hinek Dec 9 '10 at 10:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.