List<T> as Queryparameter.Value

3 posts, 0 answers
  1. Holger
    Holger avatar
    2 posts
    Member since:
    Apr 2011

    Posted 10 May 2011 Link to this post

    Hy all,
    we are currently evaluating the Telerik Silverlight Suite and I have a question.
    Actually I am still learning Silverlight and all of my code is just for Test purpose and to see how things are going.
    Now my problem:

    I have a search page with three check boxes on. Each checkbox stands for a status value (open, closed etc.).
    If it is checked, I want to include this rows in my results. All is fully functional, if I make my calls to the Context manually.

    In second step Iwanted to use the Domaindatasource, but exclusively in code behind.

    This is my Query Function:

    /// <summary>
    /// Gib Suchergebnisse zurück
    /// </summary>
    /// <param name="FSG1">Objektnummer</param>
    /// <param name="Status">Liste der Stati, nach denen gesucht werden soll</param>
    /// <returns>Ergebnisse der IQueryable</returns>
    public IQueryable<FPT> GetFPTbyWhere(string FSG1, List<string> Status)
        IQueryable<FPT> result = this.ObjectContext.FPT.Include("FSG").Include("FPTA").OrderBy(p => p.FSG1);
        if (FSG1 != string.Empty)
            result = result.Where(p => p.FSG1.Contains(FSG1));
        if (Status != null && Status.Count > 0)
            result = result.Where(p => Status.Contains(p.FPT104));
        return result;

    As you can see, I make a lambda expression against a List of strings (they are actually the values from the check boxes.
    But, when I try to use the Queryparameter with List<string> as a Parameter value, it is always null in the function above.

    Code for RadDomaindataSource:

    List<string> Status = new List<string>();
    if (cbOffen.IsChecked.Value)
    if (cbInAuftrag.IsChecked.Value)
    if (cbErledigt.IsChecked.Value)
    if (dsFPT.QueryName == "GetFPTbyWhere")
        dsFPT.QueryParameters.Single(p => p.ParameterName == "FSG1").Value = txtObjektnummer.Text;
        dsFPT.QueryParameters.Single(p => p.ParameterName == "Status").Value = Status;
        Telerik.Windows.Controls.QueryParameter param1 = new Telerik.Windows.Controls.QueryParameter();
        param1.ParameterName = "FSG1";
        param1.Value = txtObjektnummer.Text;
        Telerik.Windows.Controls.QueryParameter param2 = new Telerik.Windows.Controls.QueryParameter();
        param2.ParameterName = "Status";
        param2.Value = Status;
        dsFPT.QueryName = "GetFPTbyWhere";

    Anyone a hint?

    Is it not possible to use List objects as Query Parameter?

    Many thanks in advance.

  2. Rossen Hristov
    Rossen Hristov avatar
    2478 posts

    Posted 10 May 2011 Link to this post

    Hi Holger,

    Your question is not related to Telerik controls in any way. Please post questions like this on the WCF RIA Services forum where they belong.

    Anyway, here is a what a quick forum search returns:

    I hope this helps.

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Holger
    Holger avatar
    2 posts
    Member since:
    Apr 2011

    Posted 10 May 2011 Link to this post

    Hy Ross,

    -.-' I searched yesterday for hours in your forum and other fourms and didnt find anything related to this. Dont know why.
    Sorry, if it was not related to Telerik and many thanks for your answer and support.

    Kind regards,

Back to Top