Search code examples
c#.netwpfformswindowsformsintegration

DataGridView draw bug in WPF


I am using WindowsFormsIntegration in a WPF project to add a DataGridView and I am having some problems with it simply being drawn in the window (it takes a while).

I am aware of the solution with the doublebuffered datagridview but how can you use this in XAML for WPF or in C# for WPF?

An example of the doublebuffered datagridview in WPF with WindowsFormsIntegration or any alternative solution would really be appreciated!!

Thank you for any help provided!


Edit:

I am using Microsoft Expression Blend 2 for the interface and I noticed it generated a Resource Dictionary. Removing some of the styling in there actually solved part of the problem but I keep getting the same problem. The actions that are leading to make the GroupBox that contains the DataGridView to be visible are: clicking on a tab control then choosing a RadioButton. Once a certain RadioButtion is checked, a certain GroupBox becomes visible. It contains the WindowsFormsIntegration host which itself contains the DataGridView but the WindowsFormsIntegration does not appear (or is not drawn) until I take the mouse and put it over a button inside the GroupBox... Is Expression Blend responsible for my problems?


Solution

  • A great alternative to using windows forms integration for datagrids is using the free and total awesome native WPF datagrid by Infragistics. They call it the xamDataGrid control and it absolutely beautiful believe me. I go some major brownie points for introducing this into my company's app.

    Download page is here: http://www.infragistics.com/dotnet/netadvantage/wpf.aspx?panel=Downloads#Downloads

    Overview page: http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview

    NetAdvantage for WPF Express 2009 Vol. 1 gets you started with the xamDataGrid™ for WPF development (this is not a trial and features the real xamDataGrid version 9.1; no purchase is necessary to use it in your applications).