views:

61

answers:

2

Trying to decide on the best element to use for a grid view, pretty much exactly like the one you'd see in uTorrent or any other upload/download client. Specifically, I want to have a 'progress' column too (with progress bars). Using VS2010/.NET4. Haven't really started the project yet, so either WPF or WinForms are fine. What would you recommend?

+1  A: 

If you're willing to write some of it yourself this might be helpful:

http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/769ca9d6-1e9d-4d76-8c23-db535b2f19c2/

Nathan
A: 

Turns out, you can stuff ProgressBars right in there:

<DataGrid Name="dataGrid1" ItemsSource="{Binding Path=Items}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" HeadersVisibility="Column" GridLinesVisibility="None" AutoGenerateColumns="False">
    <DataGrid.Columns>
        <DataGridTextColumn Binding="{Binding Path=Uri, Mode=OneWay}" Header="Uri" IsReadOnly="True" />
        <DataGridTextColumn Binding="{Binding Path=Size, Mode=OneWay}" Header="Size" IsReadOnly="True" />
        <DataGridTemplateColumn Header="Progress">
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <ProgressBar Value="{Binding Path=Progress, Mode=OneWay}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
        <DataGridTextColumn Binding="{Binding Path=Eta, Mode=OneWay}" Header="Eta" IsReadOnly="True" />
        <DataGridTextColumn Binding="{Binding Path=Priority, Mode=OneWay}" Header="Priority" IsReadOnly="True" />
    </DataGrid.Columns>
</DataGrid>

Took a bit of fumbling with my near-0 knowledge of WPF, but it's looking pretty sweet so far.

Mark