c# - Add Item to ListBox from TextBox -
i have listbox:
<listbox x:name="playlistlist" alternationcount="2" selectionchanged="didchangeselection"> <listbox.groupstyle> <groupstyle /> </listbox.groupstyle> <listbox.itemtemplate> <datatemplate> <textblock text="{binding name}"/> </datatemplate> </listbox.itemtemplate> </listbox> and want add option add new item listbox. , want adding textbox listbox when user press button , user press enter , add text in textbox listbox.
i try add text box listbox can add 1 type of listbox.itemtemplate, how can handle it?
updated add textbox inside listbox:
to add new item listbox, in button click code-behind do:
textbox textboxitem = new textbox(); // set textboxitem properties here playlistlist.items.add(textboxitem);
Comments
Post a Comment