Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Missing Assembly Reference to using System.Windows.DataGrid

$
0
0

I'm using C# 2010 Express to do some testing before moving MS Access applications to Visual Studio

When I reference a datagridview in my code

DataGridView1.Rows.Add();

I get a Namespace error, specifically:

'System.Windows.Controls.DataGrid' does not contain a
definition for 'Rows' and no extension method 'Rows' accepting a first argument
of type 'System.Windows.Controls.DataGrid' could be found (are you missing a
using directive or an assembly reference?)

And when I go to add the appropriate assembly reference, it isn't allowed. If I simply add the following line:

using System.Windows.Controls.DataGrid /// I already have a reference - using System.Windows.Controls

I get the following message.

A using namespace directive can only be applied to namespaces; 'System.Windows.Controls.DataGrid' is a type not a namespace

_____________________________

When I then go to references, right-click, choose Add References, choose .NET, there is no reference object

System.Windows.DataGrid;

How do I get System.Windows.DataGrid; added to my assembly references?

Thanks in Advance - Pavilion



Viewing all articles
Browse latest Browse all 31927

Trending Articles



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