Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8646607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:51:25+00:00 2026-06-12T12:51:25+00:00

I’m trying to get the ListView to look like the MS Outlook Attachment-Control. I’ve

  • 0

I’m trying to get the ListView to look like the MS Outlook Attachment-Control. I’ve already got the horizontal scrolling, but it still displays only one item in a row.

How can I get it to look like this?
enter image description here

What I’ve achieved so far:

<Grid x:Name="grdAttachments"
      Grid.Row="4"
      Grid.Column="1"
      Grid.ColumnSpan="3">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" MaxHeight="45" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="65" />
        <ColumnDefinition Width="15" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>

    <TextBlock Grid.Column="0"
               Margin="3,0,0,0"
               HorizontalAlignment="Left"
               VerticalAlignment="Center"
               Cursor="Hand"
               Text="Angefügt:" />

    <ScrollViewer Grid.Row="0" Grid.Column="2">
        <ListBox x:Name="libAttachments"
                 Background="Transparent"
                 ItemsSource="{Binding Attachments}"
                 MouseDoubleClick="lvAttachments_MouseDoubleClick">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Margin="0,0,10,0" Orientation="Horizontal">
                        <Image Source="{Binding MimeTypeIcon}" Stretch="None" />
                        <TextBlock Margin="5,0,0,0" Text="{Binding File.Name}" />
                        <StackPanel.ContextMenu>
                            <ContextMenu>
                                <ContextMenu.Items>
                                    <MenuItem Click="btnOpenAttachment_Click" Header="Öffnen">
                                        <MenuItem.Icon>
                                            <Image Source="/Images/magnifier.png" Stretch="None" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem Click="btnSaveAttachment_Click" Header="Speichern unter">
                                        <MenuItem.Icon>
                                            <Image Source="/Images/disk-black.png" Stretch="None" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                </ContextMenu.Items>
                            </ContextMenu>
                        </StackPanel.ContextMenu>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </ScrollViewer>
</Grid>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:51:27+00:00Added an answer on June 12, 2026 at 12:51 pm

    Ok so where it seems you got snagged up was with your ListBox still pushing things in single column fashion and the lack of ability to give you something to fire off say a click event. So what I had in mind was something more like this;

    <ScrollViewer HorizontalScrollBarVisibility="Disabled" Height="300" HorizontalContentAlignment="Stretch">
    
       <ItemsControl ItemsSource="{Binding Collection}">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapPanel IsItemsHost="True"/>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <ItemsControl.ItemTemplate>
            <DataTemplate>
               <StackPanel Margin="5,0" Orientation="Horizontal">
                           <Image Source="{Binding MimeTypeIcon}" Stretch="None" />
                           <HyperlinkButton Margin="5,0,0,0" Text="{Binding File.Name}" />
                       </StackPanel>          
            </DataTemplate>
        </ItemsControl.ItemTemplate>
       </ItemsControl>
    </ScrollViewer>
    

    I wasn’t to sure what you were trying to do with your magnifier and disk though I see your Clicks for them, but you can add those to this layout however you like, just a note though, I just free-handed this between meetings so never built it but should work fine. If not we’ll plug at it again. Main differences are changing to a hyperlinkbutton to give you click and some other subtle differences from Firoso’s but his is still technically sound, or should be anyway 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.