c# - How to merge two datarow cells into one? -
i trying merge 2 datarow cells one. here initializing code:
datatable dt = new datatable(); datacolumn dc; datarow dr; dc = new datacolumn(); dc.datatype = system.type.gettype("system.string"); dc.columnname = "col1"; dt.columns.add(dc); dc = new datacolumn(); dc.datatype = system.type.gettype("system.string"); dc.columnname = "col2"; dt.columns.add(dc); dc = new datacolumn(); dc.datatype = system.type.gettype("system.string"); dc.columnname = "col3"; dt.columns.add(dc); dc = new datacolumn(); dc.datatype = system.type.gettype("system.string"); dc.columnname = "col4"; dt.columns.add(dc); dc = new datacolumn(); dc.datatype = system.type.gettype("system.string"); dc.columnname = "col5"; dt.columns.add(dc);
this code have each column in excel:
dr = dt.newrow(); dr["col1"] = ""; dr["col2"] = "quarter 1"; dr["col3"] = ""; dr["col4"] = ""; dr["col5"] = ""; dt.rows.add(dr);
and this:
but want this:
any thoughts or ideas on how can this? found rather hard merge cells.
Comments
Post a Comment