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

3 comments:

Ravichandran M. Kaushika said...

Ritesh,

thanks for a working sample. if i have to create a few of these controls, a few times in a stackpanel, do i have to copy and paste them multiple times and change control names or is there a better way.

i need to do it in code behind - not in XAML.

thanks once again for your help.

Ritesh_Kesharwani said...

Hi Ravichandran,

you can bind all these controls in codebehind also. all the controls you are creating in in XAML, you can create using C#.cs or VB.cs code,

see below code you can loop through
multiple time as you want.

Image img = new Image();
img.Source = new BitmapImage(new Uri("some.png"));

StackPanel stackPnl = new StackPanel();
stackPnl.Orientation = Orientation.Horizontal;
stackPnl.Margin = new Thickness(10);
stackPnl.Children.Add(img);

Button btn = new Button();
btn.Content = stackPnl;

Joshua Wang said...

seems like can not used in silverlight5. Besides, I don't know how to read a list and initialize it. would you mind tell me that? Thanks!