Next, you need to use a DataTemplate to display the content instead of using the DisplayMemberBinding property. Because the ListView is bound to a data source, you need to create a style that sets the HorizontalContentAlignment. To change the alignment of the ISBN column, you need to specify that the HorizontalContentAlignment property of each ListViewItem is Stretch, so that the elements in each ListViewItem can span or be positioned along the entire width of each column. In the following example, the data in the Title and ISBN columns is left-aligned. This topic shows how a ListView aligns its content by default and how to change the alignment of one column in a ListView. You can change the alignment of each column by providing a DataTemplate and setting the HorizontalAlignment property on the element within the DataTemplate. By default, the content of each column in a ListViewItem is left-aligned.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |