i have tow hidden fields, i dont want to show that filelds in the grind. i am passing the values to that fields though session. iam copying the 1st row and create a new. In that New i am pasting the 1st row values. But it displaying the Hidden field values in 2nd row.
here i attatched a JPEG file, You can see that JPEG and give me the solution. In that image in 2 row 5,5 values are hidden field values.
I have found the reason. The pasting starts from the cell you selected. The 2 hidden cell of the new row can't be selected, so the pasting starts from the 3rd cell of the row.
To fix this problem, just move the 2 hidden field(BindColumn) to the rear of the BindColumns.
In the vs.net, open your aspx file. Right click on the grid control, select worksheets designer. At the dialog window, click the "BindColumns" button at the right side, this will open the BindColumn Collection Editor. Select the field in the left side which you want to hide, use the down arrow button(at the middle of the window) to move it to the bottom of the listed fields. Click OK.
Ok, I think you may try to reconfigure dataadapter object and write SQL select statements to specify your desired field sequence (you can put the hidden fields at last before the FROM class in the select statement field list) and geneate the dataset object.
You may also write the following code to move the first BindColumn to the rear of the collection:
// Creates the data field columns automatically. sheet.CreateAutoGenratedColumns();
BindColumn bc = sheet.BindColumns[0]; // Gets the first column sheet.BindColumns.Remove(bc); // Removes it from the collection sheet.BindColumns.Add(bc); // Reinserts it to the rear of the collection bc.Width = new Unit("0pt"); // Hides it by setting its width to zero.