Hi, i have a dataset that reads an xml file. What i'm trying to do is have the first 3 child nodes viewed in a listView in 3 columns. When the listView Loads it only shows the first row of the dataset. What i need is every row to show up in the listView.
<?xml version="1.0" standalone="yes"?>
<FileList>
<file>
<serverfile>AppCopy.exe</serverfile>
<moddate>9/12/2006 11:14:54 PM</moddate>
<localpath>c:\Program Files\RTGSoftwareUpdate</localpath>
<localfile />
<action>copy</action>
<register />
<includelogins />
<excludelogins />
<shellcommand />
</file>
<file>
<serverfile>RegAsm.exe</serverfile>
<moddate>9/23/2005 12:28:56 PM</moddate>
<localpath>c:\Program Files\RTGSoftwareUpdate</localpath>
<localfile />
<action>copy</action>
<register />
<includelogins />
<excludelogins />
<shellcommand />
</file>
</FileList>
The xaml code for the listView shows something like this:
<
ListView Margin="5,50,5,94" Name="listView1">
<
ListView.View>
<
GridView>
<
GridViewColumn Header="File Name:" Width="225" DisplayMemberBinding="{Binding Path=file/serverfile}"/>
<
GridViewColumn Header="Modified Date:" Width="100" DisplayMemberBinding="{Binding Path=file/moddate}"/>
<
GridViewColumn Header="Local Path:" Width="120" DisplayMemberBinding="{Binding Path=file/localpath}"/>
</
GridView>
</
ListView.View>
</
ListView>
The Behind Code Looks Like This:
private void LoadXml(object sender, RoutedEventArgs e)
{
ds.ReadXml(
@"c:\xml\filelist2.xml");
Binding bind = new Binding();
bind.Source = ds;
listView1.SetBinding(
ListView.ItemsSourceProperty, bind);
}
Could someone point me in the right direction? Thanks.