Part1: DataGridView For WPF « C# Disciples (marlongrech.wordpress.com)

submitted by marlongrechmarlongrech(990) 1 year, 9 months ago

In real life we developers deal with a lot of data. Our job is to make this data easily accessible to the user… Unfortunately WPF does not ship with a native DataGrid (at least not for now :D ). A DataGrid is a very handy control to have because you can just feed it a list of objects and it creates columns for each property of the object. On the other hand WPF comes with a ListView, and may I say it is a very good and powerful control. The issue with the ListView is that it cannot auto generate columns for you. Also it does not support sorting or at least does not support it easily … Read more....

1 comment | category: | Views: 543

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:

posted by glennelongglennelong(0) 1 year, 1 month ago

=) Thanks for the additional informatin on controls:DataGridViewColumn. A problem I am experiencing using either method to display the DataGrid is formatting. When I try to add a WPF style, I lose the column headings. I have tried numerous settings with no joy. My goal is to do nothing more than round the corners of the otherwise boring listbox. At that point the headers seem to lose their mission and disappear.

Thanks

One Example:

<Style x:Key="RoundListBoxStyle" BasedOn="{x:Null}" TargetType="{x:Type ListView}">
<Setter Property="Foreground" Value="#FF000000" />
<Setter Property="Background" Value="LightSteelBlue" />
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="FontSize" Value="12" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListView">
<Grid x:Name="Root">
<Border Padding="5" Background="LightSteelBlue" CornerRadius="5">
<ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}">
<ItemsPresenter />
</ScrollViewer>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

information Login or create an account to comment on this story