ReoGrid icon indicating copy to clipboard operation
ReoGrid copied to clipboard

MaxContentCol does not return right value and Double Click Column Width Auto does not work.

Open LightWeight-POS opened this issue 5 years ago • 3 comments

I am creating WPF application in which I am trying to set column width as follows:

var worksheet = Workbook_Excel.CurrentWorksheet;
worksheet.SetColumnsWidth(0, worksheet.ColumnCount, 120);

After using this statement if I check content col as follows:

var che = Workbook_Excel.CurrentWorksheet.MaxContentCol;

I get wrong number of columns.

Second issue I am having is that none of the following statement is working:

worksheet.EnableSettings(WorksheetSettings.Edit_AutoExpandColumnWidth);
worksheet.SetSettings(WorksheetSettings.Behavior_DoubleClickToFitColumnWidth, true);

LightWeight-POS avatar Oct 12 '20 00:10 LightWeight-POS

I have noticed another issue, please see the following code:

var che = Workbook_Excel.CurrentWorksheet.MaxContentCol;
Max_Columns = int.Parse(che.ToString());
for (int v = Max_Columns; v > 0; v--)
            {
                var cell_2 = worksheet[1, v].ToString();
                if (cell_2 == null || cell_2 == "")
                {
                    worksheet[0, v] = null;
                    worksheet[1, v] = null;
                }
                else
                {
                    break;
                }
            }

            che = Workbook_Excel.CurrentWorksheet.MaxContentCol;
            Max_Columns = int.Parse(che.ToString());

this following code contains same number of columns before and after making data null. Can you please explain how can this be fixed ?

LightWeight-POS avatar Oct 13 '20 06:10 LightWeight-POS

I have noticed another issue, After Importing excel file the column count is wrong and is giving 199

LightWeight-POS avatar Oct 14 '20 23:10 LightWeight-POS

Similar to #271, #387

jingwood avatar Apr 03 '21 17:04 jingwood