I'm using DynamicPlaceholders in an MVC implementation of Sitecore specifically for column names in rows. For instance, I might have 3 50/50 renderings on a page, each with a column-one placeholder and a column-two placeholder. The dynamic placeholder code I'm using is working perfectly for creating new pages. But now I need to migrate existing pages from a different node into my new content tree.
I create a new RenderingDefinition item like this:
RenderingDefinition ren = new RenderingDefinition();
ren.Placeholder = "content/50-50";
ren.Datasource = [Datasource GUID];
ren.ItemID = [Rendering GUID];
device.AddRendering(ren);
Then I need to add some content items to each column of that rendering, and here's where I'm running into a problem. Somehow Sitecore stores a GUID with the above rendering I created. If you inspect the placeholder in PageEditor mode you can see a "referenceId" in the markup that corresponds to this. But I cannot figure out where it's stored so I can pass it to the following code:
RenderingDefinition col = new RenderingDefinition();
col.Placeholder = "content/50-50/column-one_[50/50 rendering placeholder guid]";
col.Datasource = [Datasource GUID];
col.ItemID = [Rendering GUID];
device.AddRendering(col);
It's definitely not a property of the RenderingDefintion, nor is it the rendering ID.