c# - Copy Dictionary<String, String> to clipboard for Excel -
i trying write tool compare 2 string tables , find values in 1 not other. have got app getting these values correctly , store them in dictionary<string, string>
, use display on gridview in xaml.
i found out have manually add copy code gridview thought have button copy entire contents of dictionary, having problem when try copy excel produces 1 column of values , need key 1 column , value another.
here copy code far:
if (totranslate.count != 0) { var sb = new stringbuilder(); foreach (var item in totranslate) { sb.append(item.key + ", "); sb.appendline(item.value); } system.windows.clipboard.setdata(dataformats.text, sb.tostring()); }
i have tried lots of other things such item.string puts them in square brackets , still doesn't work. have tried trimming square brackets still doesn't work.
i have thought have picked comma seperator when open csv doesn't.
i don't know if xaml
<listview itemssource="{binding results}"> <listview.view> <gridview> <gridviewcolumn header="name" width="100" displaymemberbinding="{binding key}" /> <gridviewcolumn header="text" width="auto" displaymemberbinding="{binding value}" /> </gridview> </listview.view> </listview>
excel likes tab character separator. import csv need import assistent of excel , thing opens in case open file contains csv data.
using tab character working how ever.
Comments
Post a Comment