Posted 8 September 2017, 1:25 pm EST
I am creating a new sheet of the current sheet and adding the sheet to the spread.
But I found that after cloning , some rows which are not in the old sheet is getting added in the new sheet. For solving this, I am taking the data source of the current sheet and storing it in a data table and binding that data table after cloning to the new sheet. Leave it it may be a bug in our code.
But now I am changing one field on Right click and setting a cell value for that row. After that if I am trying to clone a new sheet. At that time the new sheet has not reflecting the value I changed in last sheet on right click programatically.
Is it a problem with Clone() or changing some thing programatically.
Here the codes,..
DataTable dtbOriginal = objFpSpread.Sheets[objFpSpread.ActiveSheetIndex].GetDataView(true).ToTable();
FarPoint.Win.Spread.SheetView newSheet = objFpSpread.Sheets[objFpSpread.ActiveSheetIndex].Clone();
int intOldSheetIndex = objFpSpread.ActiveSheetIndex;
string strSrcScenroName = objFpSpread.Sheets[objFpSpread.ActiveSheetIndex].SheetName.ToString();
// Set the Sheet Name
newSheet.SheetName ="Ashsis ";
newSheet.Tag = 0;
//Assign original datatable to new Sheet added to spread
objFpSpread.Sheets[objFpSpread.Sheets.Count - 1].DataSource = dtbOriginal;
DataTable dtOLD = objFpSpread.ActiveSheet.GetDataView(true).ToTable();
objFpSpread.ActiveSheetIndex = objFpSpread.Sheets.Count - 1;
DataTable dtNEW= objFpSpread.ActiveSheet.GetDataView(true).ToTable();
If u check you can find dtOLD !=dtNEW;