Hi,
I am trying to add grid lines for a given excel…
#1. When I re-load a given file, it fails to apply for a particular column
"New_19122016100920 On Reload.xlsx"
#2. When I add new lines (using InsertRows), it fails to apply for all the newly inserted lines…
"New_19122016100109 On Insert Rows.xlsx"
Can you please help me understand what are the exact steps that we have to follow for getting the grid lines applied?
public override void AddRows(string sheetName, dynamic index, dynamic count)
{
if (string.IsNullOrEmpty(sheetName))
sheetName = _workbook.Worksheets[_workbook.Worksheets.ActiveSheetIndex].Name;<span style="color:blue;">var</span> worksheet = _workbook.Worksheets[sheetName]; worksheet.Cells.InsertRows(index - 1, count, <span style="color:blue;">true</span>); _workbook.CalculateFormula(<span style="color:blue;">true</span>); }</pre><pre style="font-family: Consolas; font-size: 13px; background: white;"><br></pre><pre style="font-family: Consolas; font-size: 13px; background: white;"><pre style="font-family: Consolas; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="color:blue;">public</span> <span style="color:blue;">override</span> <span style="color:blue;">void</span> ApplyGridLines(<span style="color:blue;">string</span> sheetName, <span style="color:blue;">bool</span> flag) { <span style="color:blue;">if</span> (<span style="color:blue;">string</span>.IsNullOrEmpty(sheetName)) sheetName = _workbook.Worksheets[_workbook.Worksheets.ActiveSheetIndex].Name; <span style="color:blue;">var</span> worksheet = _workbook.Worksheets[sheetName]; worksheet.IsGridlinesVisible = flag; }</pre></pre></div>