We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Inserting new rows: what can be simplier?

Thread ID:





21178 Nov 3,2004 10:18 PM UTC Dec 7,2004 04:35 PM UTC WinForms 5
Tags: GridControl
Administrator [Syncfusion]
Asked On November 3, 2004 10:18 PM UTC

I''m trying to have Following code throws me an exception. I can''t find what am I doing wrong. Removing primary key makes it work, but... private void Form1_Load(object sender, System.EventArgs e) { Syncfusion.Windows.Forms.Grid.GridDataBoundGrid grid = new Syncfusion.Windows.Forms.Grid.GridDataBoundGrid(); grid.Parent = this; DataSet ds = new DataSet(); DataTable dt = ds.Tables.Add("myTable"); for (int i=0; i<3; i++) { DataColumn col = dt.Columns.Add("myColumn_" + Convert.ToString(i), typeof(int)); } dt.Columns[0].AutoIncrement = true; // create primary key dt.Constraints.Add("myConstraint", dt.Columns[0], true); DataView dv = new DataView(dt); dv.AllowNew = true; dv.AllowEdit = true; dv.AllowDelete = true; grid.DataSource = dv; }

Administrator [Syncfusion]
Replied On November 3, 2004 11:13 PM UTC

I pasted your code into this sample to try to see the problem. As long as I type integers into the cells, I do not see any exceptions. I am using What are you doing differently to see the problem? WindowsApplication7_6772.zip

Administrator [Syncfusion]
Replied On December 7, 2004 03:29 PM UTC

I''ve been travelling, and wasn''t able to look at this issue, and now file is no longer available... Thanks!

Administrator [Syncfusion]
Replied On December 7, 2004 03:51 PM UTC

Try this link.

Administrator [Syncfusion]
Replied On December 7, 2004 03:58 PM UTC

Much appreciated. This program throws me: "An unhandled exception of type ''System.Exception'' occurred in system.dll Additional information: is not a valid value for Int32." after the last line "grid.DataSource = dv;" It''s the same thing I was getting before. I have installed, XP Pro .NET 1.1 patched with the latest MS updates... By the way, making "dv.AllowNew = false" fixes it instantly. However in my project I would need to insert data in the grid somehow.

Administrator [Syncfusion]
Replied On December 7, 2004 04:35 PM UTC

I don''t see this problem with that sample in or in You might want to download the 3.0 RC and try that. It uses a different assembly naming scheme so both 2.1.x and 3.0.x can be on the same system without worrying about getting assembly name conficts. You do habe to change the references to point to the proper assemblies.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon