I have "gameListView" ListView in which i want to add Checkbox dynamically. So How can I do this? I am able to add string but not able to add Checkbox. My Code is below.
GridView gridView = new GridView();
gameListView.View = gridView;
//Setting CheckBox here
CheckBox chk = new CheckBox();
chk.IsChecked = varibleName == "1" ? true : false;
gridView.Columns.Add(new GridViewColumn { Header = "Favourite", DisplayMemberBinding = new Binding("Favourite") });
gameListView.Items.Add(new Games.GameItems { GameName = game[0].ToString(), GameDependency = game[1].ToString(), Favourite = chk });
and my Games.GameItems class ia as follow
class GameItems
{
public string GameName { get; set; }
public string GameDependency { get; set; }
public System.Windows.Controls.CheckBox Favourite { get; set; }
}
But my Output shows CheckBox as String :( like below

But I want real CheckBox, not the string. So please help me, how can I do this?
CheckBoxcontrol as property. Add checkbox by normal way xaml/c# and then bind its value to true or false.