Hi,I have a ultragrid with data binding to a datatable from a dataset. The bound table has the following columns:RecYear primaryKey - also foreign key in linked tableRecID primaryKey - also foreign key in linked tableSampleID PrimaryKeySampleTypeSampleCountI want to only show two columns in the grid: SampleType and SampleCountInserting new data into the table is taken care of by a stored procedure which takes five parameters: @SampleType and @SampleCount.Pluss: @RecYear', '@RecID' and '@SampleID output'.The @RecYear', '@RecID' I will set in my Save method of the form. The sampleID is calculated in the stored procedure, and it is only an output parameter.The problem is that the ultragrid and/or the bound datatable cannot wait with the assigning of the primary keys until I want to 'batch save' one or more added rows. The grid throws warning after leaving the the first new row in the grid.Is is possible for make the grid ignore null-data for primary keys until updating the table on the SQL server?I use dataset, tableadapter and bindingsourcebwKai
Hi Kai,
This doesn't really have anything to do with the grid - it's the DataTable that will not allow you to commit a row without a required field.
There are probably a lot of resources on this type of problem available from Microsoft or some of their forums. I remember reading something many years ago about a technique where you change the DataTable field to product an auto-generated primary key value using negative numbers so that the row can be added temporarily, and then later on you fill in the correct key value when you commit the changes to the database and it generates a real key.
Thanks
Kai