I have two dataGridViews that load an XML file each, I made it so that you can drag rows between each grid. However, for now, all he does is copy the data from the dataGridView. This works great, however I need to copy all the XML that is relevant to this line.
Here is the XML I have to work with:
<WindowBuilderProject> <stringtable> <stentry>0..607</stentry> //All of the other records <stentry> <index>608</index> <sid>MNUB_AUTO</sid> <val> <en>AUTO</en> </val> <params> <fontref>0</fontref> <numref>0</numref> <clip>FALSE</clip> <include>TRUE</include> <protected>FALSE</protected> <cwidth>-1</cwidth> <dwidth>0</dwidth> </params> </stentry> </stringtable> </WindowBuilderProject>
So, I need to copy the XML string that the user selected and paste it into another (same format) XML document.
So far I have this:
string location = "/WindowBuilderProject/stringtable/stentry[index='" + rowIndexOfItemUnderMouseToDrop + "']"; XmlNode Copy = xDoc.ImportNode(xDoc2.SelectSingleNode(location), false); xDoc.DocumentElement.AppendChild(Copy);
It works fine, but everything that happens is what I get at the bottom of the XML file. How can I highlight the whole XML block?
Thank you very much for your help!
source share