Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Scrollable ListView with 2 Columns, and data in each

$
0
0
I am hopelessly confused in doing what I thought would be simple things (in WinForms for instance), in WPF. Any help would therefore be greatly appreciated!

I have been using Visual Studio 2012 Designer to make my application but it appears all of the online information is concerned solely with the XAML markup which I am finding quite hard to relate between the two, as dragging a control onto the designer doesn't tell me anything about how they are actually implemented.

I am trying to make a scrollable list of 2 columns, one column for a name and another for a number. I don't actually want the column-headers to be displayed.

So I have as follows in XAML:

              
<ListView HorizontalAlignment="Left" Height="73" Margin="144,77,0,0" VerticalAlignment="Top" Width="154" Background="{x:Null}" BorderBrush="{x:Null}" >
                        <ListView.View>
                            <GridView ColumnHeaderContainerStyle="{StaticResource ListViewStyle}">
                                <GridViewColumn/>
                                <GridViewColumn/>
                            </GridView>
                        </ListView.View>
                        <ListViewItem Content="Data Goes Here" Margin="0" Background="{x:Null}"/>
</ListView>



ListViewStyle is a style I put in the App.xaml file, under application resources. I don't know if there are any other places to source styles from?

The ListViewItem's content is duplicated across the two columns at the moment. How can I write: column1Content = "this" column2Content = "that"?

Is there anywhere I can learn how all this is put together? I can't even find where the application starts, to see where the XAML is called or where anything comes from.

Thanks for any help, it's certainly easy to get frustrated with Visual Studio 2012!

Richard

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>