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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Inserting new rows: what can be simplier?

Thread ID:

Created:

Updated:

Platform:

Replies:

21178 Nov 3,2004 10:18 PM UTC Dec 7,2004 04:35 PM UTC WinForms 5
loading
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 2.1.0.9. 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. http://64.78.52.104/support/user/Uploads/WindowsApplication7_6772.zip

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 2.1.0.67 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 2.1.0.9 or in 3.0.0.19. 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.

CONFIRMATION

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.

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

;