c# - How can I add textbox in last column of listview in UWP? -
i wanted add textbox below whenever last columns of listview in uwp.
thins mainpage.xaml
<grid background="{themeresource applicationpagebackgroundthemebrush}"> <listview x:name="mylist"> <listview.itemtemplate> <datatemplate> <grid> <stackpanel> <textblock text="{binding todo}" ></textblock> <textblock text="{binding checklist}"></textblock> <textblock text="{binding date}"></textblock> </stackpanel> </grid> </datatemplate> </listview.itemtemplate> </listview> </grid> if put textbox inside stackpanel. textbox shows inside column. wondering how can add textbox below whenever last column is.
thank much:)
if understand question correctly, first want show items in listview , single textbox below last item?
simply take textbox outside listview.
<grid background="{themeresource applicationpagebackgroundthemebrush}"> <stackpanel> <listview x:name="mylist"> <listview.itemtemplate> <datatemplate> <stackpanel> <textblock text="{binding todo}" ></textblock> <textblock text="{binding checklist}"></textblock> <textblock text="{binding date}"></textblock> </stackpanel> </datatemplate> </listview.itemtemplate> </listview> <textbox x:name="mytextbox" /> </stackpanel> </grid> i have used stackpanel place them below each other, can use rowdefinitions. pick whichever layout fits needs.
<grid background="{themeresource applicationpagebackgroundthemebrush}"> <grid.rowdefinitions> <rowdefinition height="auto" /> <rowdefinition height="*" /> </grid.rowdefinitions> <listview x:name="mylist" grid.row="0"> <listview.itemtemplate> <datatemplate> <stackpanel> <textblock text="{binding todo}" ></textblock> <textblock text="{binding checklist}"></textblock> <textblock text="{binding date}"></textblock> </stackpanel> </datatemplate> </listview.itemtemplate> </listview> <textbox x:name="mytextbox" grid.row="1" /> </grid> notice have removed grid in datatemplate not necessary.
Comments
Post a Comment