Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
What is the best way of working with retrieving data from datatype grid property and Ipublished content, I have so far:
var questionsRaw = page.GetPropertyValue<string>(questionField);
// Get original data
var data = new GridRowCollection(questionsRaw);
Where page is IPublishedContent or is there a propertyvalue convertor?
So in answer to my own question
var rows = page.GetPropertyValue<GridRowCollection>(questionField);
var questions=new List<GoldenQuestion>();
foreach (var row in rows)
var question = new GoldenQuestion
ControlType = row.GetCell("controlType").GetPropertyValue<string>(),
Question = row.GetCell("question").GetPropertyValue<string>(),
Answers = row.GetCell("answers").GetPropertyValue<string>().Replace(Environment.NewLine, string.Empty).Replace("\n","").Split('|').ToList() //use the trim to get rid of \r\n
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted