c# - Set Gridline Color Using EPPlus? -


is possible set worksheet's gridline color using ?

the "gridline color" option i'm trying set programmatically shown in screenshot below.

enter image description here

i dont see option in epplus. manually set attributes using xml:

[testmethod] public void sheet_gridline_color_test() {     //http://stackoverflow.com/questions/29380587/set-gridline-color-using-epplus      //throw in data     var dtmain = new datatable("tbldata");     dtmain.columns.add(new datacolumn("col1", typeof(int)));      (var = 0; < 20; i++)     {         var row = dtmain.newrow();         row["col1"] = i;         dtmain.rows.add(row);     }      var existingfile = new fileinfo(@"c:\temp\temp.xlsx");     if (existingfile.exists)         existingfile.delete();      using (var pck = new excelpackage(existingfile))     {         var ws = pck.workbook.worksheets.add("content");         ws.cells["a1"].loadfromdatatable(dtmain, true);          //can xml elements quick , dirty using relative childs should proper search in production         var wsxd = ws.worksheetxml;         var wsxml = wsxd.lastchild; //gets 'worksheet'         var sheetviewsxml = wsxml.firstchild; //gets 'sheetviews'         var sheetviewxml = sheetviewsxml.firstchild; //gets 'sheetview'          var att = wsxd.createattribute("defaultgridcolor");         att.value = "0";         sheetviewxml.attributes.append(att);          att = wsxd.createattribute("colorid");         att.value = "10";         sheetviewxml.attributes.append(att);          pck.save();     } } 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -