G
Guest
Hi,
I have and XMLDataSource which I am using in a GridView control and am
customizing the grid with <ItemTemplate>. My XML datasource has an element
with an attribute called "private". I want to check the value of the
private attribute
and if is is true, I DON'T want to display this row of data. I am having
trouble with the XPath expression. How is this done?
Here is a sample XML source
<?xml version="1.0"?><comments><comment from="Mike Smith"
private="false">comment 1</comment><comment from="Joe Doe"
private="true">comment 2</comment></comments>
Here is snippet of my page source
<asp:GridView ID="GridView1" ........
<Columns>
<asp:TemplateField>
<ItemTemplate>
<b>From: <%# XPath("./@from") %></b><br/>
Date: <%# XPath("./@date") %><br/>
Private: <%# XPath("./@private") %><br/> ??? How can I use
If here
<%# XPath(".") %><br />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Any Suggestions? Thanks.
I have and XMLDataSource which I am using in a GridView control and am
customizing the grid with <ItemTemplate>. My XML datasource has an element
with an attribute called "private". I want to check the value of the
private attribute
and if is is true, I DON'T want to display this row of data. I am having
trouble with the XPath expression. How is this done?
Here is a sample XML source
<?xml version="1.0"?><comments><comment from="Mike Smith"
private="false">comment 1</comment><comment from="Joe Doe"
private="true">comment 2</comment></comments>
Here is snippet of my page source
<asp:GridView ID="GridView1" ........
<Columns>
<asp:TemplateField>
<ItemTemplate>
<b>From: <%# XPath("./@from") %></b><br/>
Date: <%# XPath("./@date") %><br/>
Private: <%# XPath("./@private") %><br/> ??? How can I use
If here
<%# XPath(".") %><br />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Any Suggestions? Thanks.