c# - ListView showing System.Data.DataRowView instead of DataTable -
my problem every row of listview shows "system.data.datarowview" after change listview template style.
i've defined datatable here:
datatable data = new datatable(); lsvoutput.itemssource = data.defaultview;
this xaml columns:
<listview.view> <gridview> <gridviewcolumn header="column1" displaymemberbinding="{binding column1}"/> <gridviewcolumn header="column2" displaymemberbinding="{binding column2}"/> <gridviewcolumn header="column3" displaymemberbinding="{binding column3}"/> </gridview> </listview.view>
this part breaks i'm assuming:
<contentpresenter horizontalalignment="{templatebinding horizontalcontentalignment}" verticalalignment="{templatebinding verticalcontentalignment}" snapstodevicepixels="{templatebinding snapstodevicepixels}"/>
i figured out. replaced this:
<contentpresenter horizontalalignment="{templatebinding horizontalcontentalignment}" verticalalignment="{templatebinding verticalcontentalignment}" snapstodevicepixels="{templatebinding snapstodevicepixels}"/>
with this:
<gridviewrowpresenter verticalalignment="{templatebinding verticalcontentalignment}" />
source: http://msdn.microsoft.com/en-us/library/ms788747%28v=vs.110%29.aspx
Comments
Post a Comment