excel 2010 - Databar Appears only when cell edit made -
i have exported data datagridview excelsheet using epplus library
for = 0 analysis.dgv1.columns.count - 1 worksheet1.cells(1, + 1).value = analysis.dgv1.columns(i).headertext next = 0 analysis.dgv1.rows.count - 1 j = 0 analysis.dgv1.columns.count - 1 worksheet1.cells(i + 2, j + 1).value = analysis.dgv1.rows.item(i).cells(j).value next next using range = worksheet1.cells(2, 4, analysis.dgv1.rowcount, 5) range.style.numberformat.format = "#,##0" end using
column 4,5 numeric column have added databar excelsheet using
using range = worksheet1.cells(2, 4, analysis.dgv1.rowcount, 5) range.conditionalformatting.adddatabar(system.drawing.color.lightgreen) end using
in exported excelsheet data shows fine but, databars appears when cell edit made here screenshot of image
84,83 cell entered in edit mode other un touched
it's because databar needs numeric value , here entering number string try converting number before insert
Comments
Post a Comment