Thursday, February 10, 2011

Multi select combo box with Checkbox in Silverlight 4.0

Multi select combo box with Checkbox in Silverlight 4.0
I found multi select combo box on msdn and I converted into Silverlight 4.0, just copy "Main.Xmal"
and "Main.xmal.cs" into your new Silverlight 4 solution. Its works well for me with "Silverlight 4.0" and ".Net Framework 4.0"
Its look like below, you can change look and feel as you want


you can download code from here
There is another code multi select combo box source code is , its works well with Silverlight 3.0

Monday, February 07, 2011

“IN” clause in LINQ

"IN" Clause in LINQ
Some time we have a requirement to select records with more than one criteria as same as "IN" clause with SQL like:
"Where EmpId IN (1,2,3)"
We can do this with LINQ to Object also, we have to use "Contains" function like below
public static Employee[] GetEmployee(string[] EmpID)
{
        return (from p in GetEmp()
        where EmpID.Contains(p.EmployeeID)
        select p).ToArray<Employee>();
}