I have an application, on which i export data from a datagrid to a csv file. I do this with the following steps:
Create a file:
var myFile = File.Create("test.csv"); myfile.Close();
write the data to a string builder(data)
write the data to the created file.
File.WriteAllText(filepath, data);
This works fine. The resulting csv file is opened in excel. I have a column of numbers which may have preceeding zeros, when those data is exported to csv file the preceeding 0's are lost. Is it possible to format the column as text column so the zeros are not lost.