How can I display both Button and Button Name in Listbox Item from Code behind?
Posted
by Subhen
on Stack Overflow
See other posts from Stack Overflow
or by Subhen
Published on 2010-04-12T07:44:34Z
Indexed on
2010/04/12
11:53 UTC
Read the original article
Hit count: 221
Hi I have the following code , which assign a list of custom radio buttons to my List Box.
List<RadioButton> listUserControlBtns = new List<RadioButton>();
customLocalFolderButton btnLocalFolder = new customLocalFolderButton();
customLocalFolderButton btnPlayListFolder = new customLocalFolderButton();
customVideoButton btnVideoFolder = new customVideoButton();
cutsomAudioButton btnMusicFolder = new cutsomAudioButton();
customImageButton btnImageFolder = new customImageButton();
listUserControlBtns.Add(btnLocalFolder);
listUserControlBtns.Add(btnPlayListFolder);
listUserControlBtns.Add(btnVideoFolder);
listUserControlBtns.Add(btnMusicFolder);
listUserControlBtns.Add(btnImageFolder);
listMainFolder.ItemsSource = listUserControlBtns;
Now . I am able to display the radio buttons inside the listbox but also I want to display the name of the radiobutton below the radiobutton itself.This should happen for all the radiobuttons inside the listbox.
I dont want to use binding in XAML . Your suggestions and solutions will help me in a great way.
Thanks, Subhen
© Stack Overflow or respective owner