Hi.
Because I had wanted to acquire the displayed data by CSV, I tried. Though it returns the result in order of sorting, not to have obtained the means to describe it clearly is my regret. Is this code adequate?Are there more adequate methods or more simple expedients?
public static string CreateCsvString(XamDataGrid xamDataGrid){ return string.Join("\n", ( from DataRecord dataRecord in xamDataGrid.Records where Visibility.Visible == dataRecord.VisibilityResolved select string.Join(",", ( from cell in dataRecord.Cells where Visibility.Visible == cell.Field.VisibilityResolved orderby cell.Field.ActualPosition.Column select string.Format("\"{0}\"", cell.ConvertedValue.ToString().Replace("\"", "\"\""))).ToArray())).ToArray());}
Thanks for reading my poor English and cruel code.
Hello,
I apologize no one has answered your post yet. Are you still looking for a solution? If so, would you be able to better describe the desired results you are looking for?
Thank you!