Home Forums WPF controls Xceed DataGrid for WPF Need help with my binding

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26634 |

    I can’t get this to work right… it compiles ok and the column headers are right… and the XmlDataSource is right because I use the same source in another project (though not with the Xceed Datagrid).

    <Window x:Class=”Exocet.Window1″
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;
    xmlns:s=”clr-namespace:System;assembly=mscorlib”
    xmlns:local=”clr-namespace:Xceed.Wpf.Documentation”

    Title=”Exocet” Height=”527.5″ Width=”700″ Background=”#FF3B3B3B” xmlns:my=”clr-namespace:Xceed.Wpf.DataGrid;assembly=Xceed.Wpf.DataGrid” xmlns:my1=”clr-namespace:Xceed.Wpf.DataGrid.Views;assembly=Xceed.Wpf.DataGrid”
    Loaded=”window_Loaded” Closing=”DataWindow_Closing” BorderThickness=”3″ AllowsTransparency=”True” WindowStyle=”None”>

    <Grid Margin=”0,40,0,0″>
    <Grid xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid&#8221; >
    <Grid.Resources>
    <XmlDataProvider x:Key=”xmlData”
    Source=”c:\program files\msts\serialized.xml”
    XPath=”/MSTSSchedule/m_Schedule”/>
    <xcdg:DataGridCollectionViewSource x:Key=”cvs_xml” Source=”{Binding Source={StaticResource xmlData}}”>
    <xcdg:DataGridCollectionViewSource.ItemProperties>
    <local:XmlDataGridItemProperty Name=”StartTime”
    DataType=”{x:Type s:DateTime}”
    Title=”Start” />
    <local:XmlDataGridItemProperty Name=”EndTime”
    DataType=”{x:Type s:DateTime}”
    Title=”End” />
    <local:XmlDataGridItemProperty Name=”Summary”
    DataType=”{x:Type s:String}”
    Title=”Summary” />
    <local:XmlDataGridItemProperty Name=”Attendee”
    DataType=”{x:Type s:String}”
    Title=”Attendee” />
    <local:XmlDataGridItemProperty Name=”Description”
    DataType=”{x:Type s:String}”
    Title=”Description” />
    <local:XmlDataGridItemProperty Name=”Location”
    DataType=”{x:Type s:String}”
    Title=”Location” />
    <local:XmlDataGridItemProperty Name=”Private”
    DataType=”{x:Type s:Boolean}”
    Title=”Private” />
    <local:XmlDataGridItemProperty Name=”Status”
    DataType=”{x:Type s:String}”
    Title=”Status” />
    </xcdg:DataGridCollectionViewSource.ItemProperties>
    </xcdg:DataGridCollectionViewSource>
    </Grid.Resources>

    Can anyone help me see what I’m missing? Is there a way to view the Xmldatasource inside the debugger?

    Imported from legacy forums. Posted by yahgrid27 (had 2553 views)

    Xceed Support
    Member
    Post count: 5658

    Support for XmlDataSource is not yet fully built-in. I suggest you take a look at this post that demonstrates what you want to do:

    <a href=”http://forums.xceed.com/Forums/ShowPost.aspx?PostID=11343″>http://forums.xceed.com/Forums/ShowPost.aspx?PostID=11343</a&gt;

    Imported from legacy forums. Posted by Jenny [Xceed] (had 162 views)

    User (Old forums)
    Member
    Post count: 23064

    I had found your example before and copied it entirely, also including the two support C# functions.

    So not sure what I am doing wrong… here’s a sample of the XML file I’m trying to read:

    <?xml version=”1.0″ encoding=”utf-8″?>
    <MSTSSchedule xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;
    <m_Schedule>
    <MSTSAppointment>
    <Summary>Operations Manager stuff</Summary>
    <Location>Work in my office</Location>
    <Description>Open ERs, approve time, 1-on-1 meetings, cost center analysis.

    Goto: http://www.foxnews.com</Description&gt;
    <Priority>0</Priority>
    <Attendee>administrator</Attendee>
    <Private>false</Private>
    <Categories />
    <Created>2008-04-01T17:05:13.201</Created>
    <StartTime>2008-04-01T06:00:00</StartTime>
    <EndTime>2008-04-01T16:30:00</EndTime>
    <ID>0</ID>
    <Status>unknown</Status>
    <Information />
    </MSTSAppointment>
    <MSTSAppointment>
    <Summary>Mid-year review updates</Summary>
    <Location>Mid-year review updates</Location>
    <Description>Yahoo appointment</Description>
    <Priority>0</Priority>
    <Attendee>me</Attendee>
    <Private>false</Private>
    <Created>0001-01-01T00:00:00</Created>
    <StartTime>2008-04-01T07:00:00</StartTime>
    <EndTime>2008-04-01T08:00:00</EndTime>
    <ID>0</ID>
    <Status>Scheduled</Status>
    </MSTSAppointment>
    <MSTSAppointment>
    <Summary>Another Outlook appointment</Summary>
    <Location>The location</Location>
    <Description>Some appointment from Outlook</Description>
    <Priority>0</Priority>
    <Attendee>administrator</Attendee>
    <Private>false</Private>
    <Created>2008-04-01T17:05:11.329</Created>
    <StartTime>2008-04-01T09:00:00</StartTime>
    <EndTime>2008-04-01T16:30:00</EndTime>
    <ID>0</ID>
    <Status>unknown</Status>
    <Information />
    </MSTSAppointment>
    </m_Schedule>
    </MSTSSchedule>

    Again, I get the header but no detail rows.

    Imported from legacy forums. Posted by yahgrid27 (had 3557 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.