I am using the Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl. I have followed a process similar to the tutorial "Project1- Binding a GridGroupingControl to a MDB file" except in my case I am using SQL server and stored procedures. I have used the "Generate Dataset" feature from right clicking on the data adapter to add a dataset to my design surface.
The problem comes when I attempt to set the DataSource property of the GridGroupingControl to the dataset. I can specify the correct dataset in Properties but as soon as I move focus away from the DataSource property, there is a brief pause before a System.StackOverflowException occurs. If I take up the invite to attach a debugger, the actual crash seems to be occuring within System.Drawing.Graphics.DrawImage
While I was writing this, I just tested something new and discovered that there was a problem with my querystring associated with the data adapter. I think what is happening is that the designer is attempting to run the query in order to get the metadata (column names) etc. for the Grid Headings. As the bad querystring is causing the data adapter to return an error instead of the metadata the whole of VS.NET crashes potentially causing loss of work. I think the Designer code of the GridGroupingControl needs looking at to cope with an error response from the data adapter more gracefully. Now that I have corrected the query string, the grid design surface is painting correctly but I thought you may want to know about this issue as I lost an hours work from the crash and others may do to.
ADAdministrator Syncfusion Team July 12, 2004 01:22 AM
I tried to reproduce this problem in our tutorial by entering an bad Command text for teh query. Just making a column name invalid did not lock things up for me. I got an invalid parameter messagebox, and was able to correct the problem at that point.
What was the exact nature of the problem in your query string so we can try to reproduce the problem to see if there is something we can do to avoid the lock up.
ADAdministrator Syncfusion Team July 12, 2004 02:37 AM
When I had the problem I had configured the System.Data.SqlClient.SqlConnection with a
ConnectionString taken from the configuration file (Click on DynamicProperties-ConnectionString-''Map property to key in configuration file''). I had set it to AppDatabaseDSN which is specified in the app.config as:
With this connection string, I generated the dataset and then assigned the dataset to the grid. After moving off the grid dataset property field VS.NET crashed. After restarting and rebuilding the form to the same point as before, I tried the same thing a couple of times over. Crash each time. I then tried an alternative way of setting the connection string by clicking on the drop down for the ConnectionString property of SqlConnection - this listed a connection that I had specified in the Data Connection pane (Server Explorer). The connection string was fuller but otherwise similar - "workstation id=MyWorkstation;packet size=4096;user id=sa;data source=localhost;persist security info=True;initial catalog=AppDatabase;password=password"
With this connection string, VS.NET did not crash when I assigned the associated dataset to the grid. Instead it painted the grid in design mode showing the column headings that it had extracted from the query. As a test I went back to the old way of specifying the connection string, and the crash occurred again. I don''t know why the original connection string (or way of specifying it) should not work, but I guess funny things just happen sometimes...:)