ExtendedDataGrid Trouble Using

Nov 13, 2012 at 3:32 PM
Edited Nov 13, 2012 at 3:34 PM

Hello. I am very interested in using this as it will fix many problems I'm having with the stock WPF data grid. No matter how I try to use this I cannot get a working project. When I drag and drop from the 'Toolbox' an error dialog pops up: "Object reference not set to an instance of an object."  If I paste: 

 

<ExtendedGridControl:ExtendedDataGrid x:Name="grid" GroupByControlVisibility="Collapsed" AutoGenerateColumns="True" ItemsSource="{Binding TestDataTable}">
            
</ExtendedGridControl:ExtendedDataGrid>

 

into the XAML I get an error: ExtendedGridControl:ExtendedDataGrid was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

If I add it in code to a grid: 

 

ExtendedGrid.ExtendedGridControl.ExtendedDataGrid dg = new ExtendedGrid.ExtendedGridControl.ExtendedDataGrid();
            dg.AutoGenerateColumns = true;
            dg.GroupByControlVisibility = System.Windows.Visibility.Collapsed;

            dg.ItemsSource = adapter.MappablePoints;
            this.grid.Children.Add(dg);

 

There is an error at this.grid.Children.Add(dg) an XamlParseException was unhandled: "'The invocation of the constructor on type 'WpfApplication1.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'."

 

I'm not sure what else I can do. I downloaded the source and built the dll. I'm referencing ExtendedGrid.dll.

 

Thanks,
Justin  

Coordinator
Nov 13, 2012 at 4:01 PM

Hi,

I attached sample project which is working fine at my end.

You can download it from this location http://download-codeplex.sec.s-msft.com/Download?ProjectName=wpfextendeddatagrid&DownloadId=529122

If this too wont work for you , please share your project with me I will try to fix your problem.

 

Regards,

bpoojary

 

Nov 13, 2012 at 6:46 PM
Edited Nov 13, 2012 at 6:53 PM

Hi. Thank you for the project. It seems my dll was corrupt. I copied the one in your project to my project and I am able to view the grid and add it to XAML. I am however having trouble binding data. I am trying to display a ReadOnlyObservableCollection. If I set it in XAML the collection is not shown. If I do 

grid.ItemsSource = objectA.readOnlyCollection;

then a XamlParseException was unhandled is thrown. When placed either before or after InitializeComponent(). This happens in both the project you linked and my project. 

 

Exception:

'The invocation of the constructor on type 'WpfApplication1.MainWindow' that matches the specified binding constraints threw an exception.' Line number '4' and line position '9'.
Coordinator
Nov 14, 2012 at 1:48 AM

Hi,

Autofilter funtionality is designed to work only with datatable.
Can you please change underlying itemsource to datatable?.

Regards,
bpoojary

On Nov 14, 2012 1:16 AM, "jmmooney" <notifications@codeplex.com> wrote:

From: jmmooney

Hi. Thank you for the project. It seems my dll was corrupt. I copied the one in your project to my project and I am able to view the grid and add it to XAML. I am however having trouble binding data. I am trying to display a ReadOnlyObservableCollection. If I set it in XAML the collection is not shown. If I do

grid.ItemsSource = objectA.readOnlyCollection;

Then the XamlParseException was unhandled is thrown. This happens in both the project you linked and my project.

Exception:

'The invocation of the constructor on type 'WpfApplication1.MainWindow' that matches the specified binding constraints threw an exception.' Line number '4' and line position '9'.




Read the full discussion online.

To add a post to this discussion, reply to this email (WPFExtendedDataGrid@discussions.codeplex.com)

To start a new discussion for this project, email WPFExtendedDataGrid@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Nov 15, 2012 at 2:18 PM

I see. There is no way to change the itemsource to a datatable.  I hate that I cannot use this but look forward to further development of your project.

-Justin

Coordinator
Nov 15, 2012 at 11:43 PM
Hi,

I will try to make the source generic, will keep you updated.

Regards,
bpoojary

On Fri, Nov 16, 2012 at 1:17 AM, jmmooney <notifications@codeplex.com> wrote:

From: jmmooney

I see. There is no way to change the itemsource to a datatable. I hate that I cannot use this but look forward to further development of your project.

-Justin

Read the full discussion online.

To add a post to this discussion, reply to this email (WPFExtendedDataGrid@discussions.codeplex.com)

To start a new discussion for this project, email WPFExtendedDataGrid@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Coordinator
Nov 17, 2012 at 5:32 PM

Hi

I have made changes to make this grid work with any kind of ICollectionView collection. Kindly download the latest source code and let me know if you find any issue with Filter functionality.

Change Set Number: 20039

Regards,

bpoojary

Nov 19, 2012 at 2:38 PM
Edited Nov 19, 2012 at 2:40 PM

Hello. Thank you for the changes. However, I'm having trouble using it. I downloaded the latest source code, opened the solution in VS10, and built it. Then I added the ExtendedGrid.dll to the project you post here on 'Nov 13 at 11:01 AM.' In MainWindow.xaml ExtendedGridControl:ExtendedDataGrid is throwing 'Object reference not set to an instance of an object.'

I zipped up both solutions if you want to have a look at what I'm doing. I've never had this much trouble getting a project to work :/.

 

Download from Google Drive: http://goo.gl/SGk2g (to save: Ctrl+S or File>Download)

Coordinator
Nov 19, 2012 at 2:53 PM

Hi

I don't have access to http://goo.gl/SGk2g , kindly give me access.

 

Regards,

bpoojary

Coordinator
Nov 19, 2012 at 3:38 PM

Hi,

I was able to execute both the project successfully. Can you please use this dll in your own dummy project and post the project here.

I will try to resolve your issue asap.

Please use ExtendedDatagrid.dll and let me know if you face any issue.

 

Regards,

bpoojary 

Nov 19, 2012 at 3:57 PM

bpoojary,


Thank you. Did you mean to link a file? I cannot find ExtendedDatagrid.dll.

Coordinator
Nov 19, 2012 at 4:30 PM

Hi

Download the dll from this location http://download-codeplex.sec.s-msft.com/Download?ProjectName=wpfextendeddatagrid&DownloadId=534241

Use it in your own project and let me know if you face any issue with it.

If you face please send me mock project.

 

Regards,

bpoojary

Nov 20, 2012 at 1:28 PM
Edited Nov 20, 2012 at 1:30 PM

Hello. I created a new WPF project (.NET 4.0). Added the dll you linked above. I still get the null reference exception on the ExtendedDataGrid.

Intellisense shows that 'ExtendedGridControl:ExtendedDataGrid' exists. Exception is below:

 

   at ExtendedGrid.Styles.DataGridGeneric.System.Windows.Markup.IStyleConnector.Connect(Int32 connectionId, Object target)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
   at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
   at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)
   at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
   at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
   at System.Windows.FrameworkElement.ApplyTemplate()
   at Microsoft.Expression.Platform.WPF.WpfViewNodeManager.EnsureElementInDictionary(Object root, ViewNode knownAncestor)

 

 

I am sharing the zip of the mock project with your Gmail address. Link: http://goo.gl/Z5moc

 

Edit: I add 'xmlns:ExtendedGridControl="clr-namespace:ExtendedGrid.ExtendedGridControl;assembly=ExtendedGrid"' to Main.xaml. Is there anything I'm missing?

Coordinator
Nov 20, 2012 at 1:49 PM

Hi

Attached projects works fine at my end, can you please let me know when you get this issue?

How to reproduce this issue.

I am using Visual Studio 2010 to open this project.

Regards,

bpoojary

 

 

Nov 20, 2012 at 2:13 PM
Edited Nov 20, 2012 at 2:16 PM

So you open the project and an execute it with no problem? When I build the project an exception is thrown in the MainWindow.xaml, picture link below. I don't think I'm destined to use your project :\. I just tried this on a co-workers machine with the same results (not working).

Image Link: http://postimage.org/image/s4bmoh7ax/full/

If I add code to MainWindow.xaml.cs an exception is thrown after starting debugging and before the window opens. It opens a tab titled 'No Source Available' and an exception dialog box. The code is first then the exception in the dialog box is below:

using System;
using System.Windows;
using ExtendedGrid;

namespace ExtendedGrid_MOCK
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            ExtendedGrid.ExtendedGridControl.ExtendedDataGrid d = new ExtendedGrid.ExtendedGridControl.ExtendedDataGrid();
            this.AddChild(d);
        }
    }
}

Exception:

'The invocation of the constructor on type 'ExtendedGrid_MOCK.MainWindow' that matches the specified binding constraints threw an exception.' Line number '4' and line position '9'.
Coordinator
Nov 20, 2012 at 2:29 PM

Hi,

Can you check if you can run the project by pressing Ctrl+F5?

I was able to execute the project at my end with last code snippet. I believe there is some designer issue should not come in run time.

 

Regards,

bpoojary

Nov 20, 2012 at 2:37 PM

When I runt the project (Ctrl+F5) an error report box pops up. Image: http://postimage.org/image/41s7jv6kf/

 

Thanks

Coordinator
Nov 20, 2012 at 3:00 PM

Hi

Can you give me your Visual Studio version, there is no issue with the code or dll ?

If you can install or run the source code without any issue , then you should be able to use the dll too.

One solution would be add full source code of ExtendedDatagrid project inside solution and try again.

Regards,

bpoojary

Nov 22, 2012 at 1:00 PM
Edited Nov 22, 2012 at 1:08 PM

Hello,

I am getting a similar error. I am using Visual Studio Express  2010.  The error occurs in every project i use the ExtendedGrid post build 20033. A build which works for me is 19539.

Seems like a theme issue, but i can't resolve it.

 

Object reference not set to an instance of an object.
   at ExtendedGrid.Styles.DataGridGeneric.System.Windows.Markup.IStyleConnector.Connect(Int32 connectionId, Object target) in c:\Users\rudnikd.JF\Desktop\wpfextendeddatagrid-20142\ExtendedGrid\Styles\DataGrid.Generic.xaml:line 1160
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
   at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
   at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)
   at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
   at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
   at System.Windows.FrameworkElement.ApplyTemplate()
   at Microsoft.Expression.Platform.WPF.WpfViewNodeManager.EnsureElementInDictionary(Object root, ViewNode knownAncestor)

 

Best Regards

S.

Coordinator
Nov 22, 2012 at 1:15 PM

Hi,

I am trying to replicate this issue at my end but I am not. Can you add entire project and try to catch the exception?

Meanwhile I will try to fix this issue.

Regards,

bpoojary

Nov 22, 2012 at 1:42 PM

Hello.

Well it happens in the downloaded project(from the source code download) when i try to run the test client build no. 20143

 

Regards

S

Coordinator
Nov 22, 2012 at 1:44 PM

Hi,

Can you try to take change set number 20187. I recently checked in in.

Issue is related to visual studio . Hope so this check in resolves the issue.

I will try to download the express and try to replicate it.

 

Regards,

bpoojary

Nov 22, 2012 at 1:54 PM
Edited Nov 22, 2012 at 2:38 PM

Hello,

Still the same.

It looks like the style doesn't load at all.

When i do the following :

<ExtendedGridControl:ExtendedDataGrid Style="" ItemsSource="{Binding SourceTable}" RowHeaderWidth="17" AutoGenerateColumns="False" HideColumnChooser="False" 
IsSynchronizedWithCurrentItem="True" SelectionMode="Extended" SelectionUnit="CellOrRowHeader" >

The error is gone in the designer and it shows up with the default windows grid style. For obvious reasons it doesn't run. But it looks like something with the style is wrong.

the designer points to this line in Datagrid.Generic.xaml

 <ContentControl x:Name="groupByContentControl" VerticalContentAlignment="Center" Background="{DynamicResource DynamicHeaderBackgroundBrush}" PreviewMouseDown="RemoveGroupByMouseDown" HorizontalAlignment="Stretch">

Best regards

S

Nov 22, 2012 at 3:08 PM
Edited Nov 22, 2012 at 3:14 PM

Hello,

I figured out what the source of the problem is . It is the changes you have made in build 19789 to DataGrid.Generic.xaml

<Button Style="{x:Null}" Background="{DynamicResource DynamicHeaderBackgroundBrush}" ContextMenu="{StaticResource DataGridHeaderColumnChooser}">

I have removed the ContextMenu and the code runs. I still don't understand why it gives and error i guess it is up to you now. I hope the removal won't give me any additional error.

But thanks for the fast support. And you are doing amazing work here.

 

Best regards

S.

 

Coordinator
Nov 22, 2012 at 5:21 PM
Edited Nov 22, 2012 at 5:21 PM

Hi,

Thanks I will remove it too. It was added because if all columns are removed there was no way to add them back.

Regards,

bpoojary

Nov 22, 2012 at 6:35 PM
Edited Nov 22, 2012 at 6:36 PM

Hi again,

<Button Style="{x:Null}" Background="{DynamicResource DynamicHeaderBackgroundBrush}" ContextMenu="{DynamicResource DataGridHeaderColumnChooser}">

I have changed this line back, but instead of StaticResource i made it DynamicResource and it works for me maybe you can test it. Then we have the problem solved.

Best Regards

S.