K
kpg
Hi all,
I have a gridview bound to an xmldatasource using itemtemplets and xpath
to bind the xml data to the grid.
I have a (hidden) column in the grid that contains a particular child
node from my data set.
So my xml is of the form:
<xml>
<record>
<data1>Some data</data1>
<data2>Some other data</data2>
<data3>
<childdata1>child data</childdata1>
<childdata2>more child data</childdata2>
</data3>
</record>
</xml>
The gridview is as follows:
<asp:TemplateField HeaderText="col1">
<ItemTemplate>
<%#XPath("data1")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="col2">
<ItemTemplate>
<%#XPath("data2")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="col3">
<ItemTemplate>
<%#XPath("data3")%>
</ItemTemplate>
</asp:TemplateField>
what I get in col3 is:
child datamore child data
what I want is:
<childdata1>child data</childdata1><childdata2>more child data
</childdata2>
So that I can use javascript to parse the xml child node fragment and
build a dynamic info box in response to some user event.
Is there a way to get the outer xml instead of only the text?
Thanks,
kpg
I have a gridview bound to an xmldatasource using itemtemplets and xpath
to bind the xml data to the grid.
I have a (hidden) column in the grid that contains a particular child
node from my data set.
So my xml is of the form:
<xml>
<record>
<data1>Some data</data1>
<data2>Some other data</data2>
<data3>
<childdata1>child data</childdata1>
<childdata2>more child data</childdata2>
</data3>
</record>
</xml>
The gridview is as follows:
<asp:TemplateField HeaderText="col1">
<ItemTemplate>
<%#XPath("data1")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="col2">
<ItemTemplate>
<%#XPath("data2")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="col3">
<ItemTemplate>
<%#XPath("data3")%>
</ItemTemplate>
</asp:TemplateField>
what I get in col3 is:
child datamore child data
what I want is:
<childdata1>child data</childdata1><childdata2>more child data
</childdata2>
So that I can use javascript to parse the xml child node fragment and
build a dynamic info box in response to some user event.
Is there a way to get the outer xml instead of only the text?
Thanks,
kpg