WPF GridView: Newspaper column?

I'm not sure how else to describe it, except that he calls it a “newspaper” column.

Essentially, I have a potentially long list of codes that I want to display in the grid, and I have limited vertical real estate. I would like to show these codes (all from the same database column) in several columns, possibly 3-5 columns.

I can completely split the data into separate sources and bind them separately if this is the best solution, but I thought there might be a simple, built-in way to do this using WPF.

+3
source share
2 answers

This is actually trivial using WrapPanel.

:

<WrapPanel Orientation="Vertical">
  <ItemOne />
  <ItemTwo />
  ...
</WrapPanel>

:

<ItemsControl ItemsSource="...">
  <ItemsControl.ItemsPanel>
    <ItemsPanelTemplate>
      <WrapPanel Orientation="Vertical" />
    </ItemsPanelTemplate>
  </ItemsControl.ItemsPanel>
  <ItemsControl.ItemTemplate>
    <DataTemplate DataType="...">
      ...
    </DataTemplate>
  </ItemsControl.ItemTemplate>
</ItemsControl>

ItemsControl ListBox ComboBox . , . ListView GridView, .

+5

, - , . ItemsPanelTemplate .

, , , Grid . .

, ActualHeight, , , . , , , , .

0

Source: https://habr.com/ru/post/1735069/


All Articles