I would like to duplicate the active Row of my Datagrid. Background: Users have been working with Excel for input Data, now I am developing new Data input application in .NET. So they have been able to copy rows/columns in Excel (right mouse functions).
I have to offer them any alike function to be abls to save some typing.
So I want to realize a button that can be clicked and the active row is inserted as a copy into the datagrid.
I tried it like that:
- defined global Array
- putting event handler on event currentCellChanged in Datagrid
- reading all columns of current Cell and putting the values into the array
- on Button Click inserting the Array values into a new DataRow and putting this DataRow into DataTable of the Dataset
My Problem: If I insert the Array Values into the Dataset.Datatable I get an error because it is tried to insert the first value into the Database Columnd that coutains the primays key (auto value). This value should be ignored!
Could anyone please help me realizing this issue?