Home Forums WPF controls Xceed DataGrid for WPF Content not visible

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

    Hi,
    I’m newbie in WPF and feel little bit confused. 🙂

    Code:
    <Window x:Class=”XceedTestingApp.Window1″
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;
    xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid&#8221;
    Title=”XceedTestingApp” Height=”300″ Width=”300″
    >

    <Window.Resources>
    <XmlDataProvider
    x:Key=”config”
    Source=”C:\Temp\test.xml”
    XPath=”/Library/Department/Book” />
    </Window.Resources>

    <xcdg:DataGridControl
    ItemsSource=”{Binding Source={StaticResource config}}”
    AutoCreateColumns=”False”>
    <xcdg:DataGridControl.Columns>
    <xcdg:Column
    Title=”Name”
    FieldName=”name”
    Width=”200″
    DisplayMemberBinding=”{Binding XPath=name}”/>
    </xcdg:DataGridControl.Columns>
    </xcdg:DataGridControl>
    </Window>

    XML file: (C:\Temp\test.xml)
    <Library>
    <Department name=”Adventure”>
    <Book>
    <Name>Arizona travelling</Name>
    <Author>A. Malfoy</Author>
    <Price>123</Price>
    </Book>
    <Book>
    <Name>Seven samurays</Name>
    <Author>John Doe</Author>
    <Price>101</Price>
    </Book>
    <Book>
    <Name>Sitting in bedroom</Name>
    <Author>Jack Stack</Author>
    <Price>59</Price>
    </Book>
    <Book>
    <Name>Do your laundry</Name>
    <Author>Jane Marten</Author>
    <Price>88</Price>
    </Book>
    </Department>
    <Department name=”Crime”>
    <Book>
    <Name>Three murders</Name>
    <Author>William O. Pacific</Author>
    <Price>122</Price>
    </Book>
    </Department>
    <Department name=”Cooking”>
    <Book>
    <Name>My best friend – amarouns</Name>
    <Author>Gigi Mortano</Author>
    <Price>23</Price>
    </Book>
    </Department>
    <Department name=”Sport”>
    <Book>
    <Name>Victories</Name>
    <Author>John Winner</Author>
    <Price>78</Price>
    </Book>
    </Department>
    </Library>

    Well, I execute this code, datagrid looks nice, but I can’t see any text in datagrid cells. But the amount of cells is right (8).
    What am I doing wrong?

    Thanks for your help.

    Imported from legacy forums. Posted by Lukas (had 436 views)

    User (Old forums)
    Member
    Post count: 23064

    Sorry, number of cell should be of course 7.

    Imported from legacy forums. Posted by Lukas (had 348 views)

    User (Old forums)
    Member
    Post count: 23064

    You should try
    DisplayMemberBinding=”{Binding XPath=Name}”/> instead of
    DisplayMemberBinding=”{Binding XPath=name}”/>

    To my mind, It’s case sensitive.

    Imported from legacy forums. Posted by valentin (had 281 views)

    User (Old forums)
    Member
    Post count: 23064

    Yes, you are right. Oh, Goood!

    I will kill myself. 🙂 Thanks.

    Imported from legacy forums. Posted by Lukas (had 3566 views)

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