This question is locked. New answers and comments are not allowed.
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:
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:
Anyone a hint?
Is it not possible to use List objects as Query Parameter?
Many thanks in advance.
Holger
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){ Status.Add("0");}if (cbInAuftrag.IsChecked.Value){ Status.Add("1");}if (cbErledigt.IsChecked.Value){ Status.Add("2");}if (dsFPT.QueryName == "GetFPTbyWhere"){ dsFPT.QueryParameters.Single(p => p.ParameterName == "FSG1").Value = txtObjektnummer.Text; dsFPT.QueryParameters.Single(p => p.ParameterName == "Status").Value = Status;}else{ dsFPT.BeginInit(); 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.QueryParameters.Add(param1); dsFPT.QueryParameters.Add(param2); dsFPT.QueryName = "GetFPTbyWhere"; dsFPT.EndInit();}dsFPT.Load();Anyone a hint?
Is it not possible to use List objects as Query Parameter?
Many thanks in advance.
Holger