Home Forums WPF controls Xceed DataGrid for WPF No Display For Xceed.Wpf.DataGrid.Samples.DataBinding sample

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

    Hi,

    Try to learn how to use Xceed DataGrid For WPF, I download the Xceed Component, then I install it, and now open Xceed.Wpf.DataGrid.Samples.DataBinding sample and try open MainPage.xaml in designer window, It displays this message “Whoops!

    Visual Studio has encountered an error reading the designer file. The errors are shown in the task list.
    Make appropriate changes to the designer file and then click on the Deisgn button to try again.”.

    Can anyone tells me how to fixed this? When I run the project, it displays the MainWindow ok but no colors other than gray,white and black unlike shown in Live Explorer. Is this normal appearance?

    Here is xaml code for MainPage.xaml:

    <!–
    Xceed DataGrid for WPF – SAMPLE CODE – Data Binding Sample Application
    Copyright (c) 2005-2007 Xceed Software Inc.

    [MainPage.xaml]

    This Page contains the UI declarations of the Data Binding sample.

    This file is part of the Xceed DataGrid for WPF product. The use
    and distribution of this Sample Code is subject to the terms
    and conditions referring to “Sample Code” that are specified in
    the XCEED SOFTWARE LICENSE AGREEMENT accompanying this product.
    –>

    <Page x:Class=”Xceed.Wpf.DataGrid.Samples.DataBinding.MainPage”
    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;
    xmlns:local=”clr-namespace:Xceed.Wpf.DataGrid.Samples.DataBinding”
    xmlns:s=”clr-namespace:System;assembly=mscorlib”
    xmlns:sc=”clr-namespace:System.Collections;assembly=mscorlib”>
    <Page.Resources>
    <!–Defined specific template for correctly showing the ColumnManagerRow and
    GroupByControl when we are displaying the grid as a card view–>
    <DataTemplate x:Key=”cardViewColumnManagerRowAndGroupByControl”>
    <DockPanel MinHeight=”60″>
    <Border DockPanel.Dock=”Right”
    Height=”{Binding ElementName=groupByControl, Path=ActualHeight, Mode=OneWay, FallbackValue=60}”>
    <xcdg:ColumnManagerRow x:Name=”columnManagerRow”/>
    </Border>
    <xcdg:GroupByControl x:Name=”groupByControl”/>
    </DockPanel>
    </DataTemplate>

    <!–A data provider to bind to the Period enum–>
    <ObjectDataProvider x:Key=”periods”
    MethodName=”GetValues”
    ObjectType=”{x:Type local:Period}”>
    <ObjectDataProvider.MethodParameters>
    <x:Type TypeName=”local:Period”/>
    </ObjectDataProvider.MethodParameters>
    </ObjectDataProvider>

    <!–A data template that will be used to represent a supplier with its company name–>
    <DataTemplate x:Key=”supplierDataTemplate”>
    <TextBlock Text=”{Binding CompanyName}”
    TextTrimming=”{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type xcdg:Cell}}, Path=ParentColumn.TextTrimming}”
    TextWrapping=”{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type xcdg:Cell}}, Path=ParentColumn.TextWrapping}”/>
    </DataTemplate>

    <!–A cell content template that will be used to represent a SupplierID with its company name–>
    <DataTemplate x:Key=”supplierCellDataTemplate”>
    <local:SupplierIDDictionary Key=”{TemplateBinding Content}”
    MinHeight=”22″
    ContentTemplate=”{StaticResource supplierDataTemplate}”>
    </local:SupplierIDDictionary>
    </DataTemplate>

    <!–A cell editor that will be used to edit a SupplierID column with a combo box–>
    <xcdg:CellEditor x:Key=”supplierEditor”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <ComboBox BorderThickness=”0″
    Background=”Transparent”
    Foreground=”{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(TextElement.Foreground)}”
    MinHeight=”22″
    VerticalContentAlignment=”Top”
    SelectedValuePath=”SupplierID”
    ItemsSource=”{Binding Source={x:Static Application.Current},Path=Suppliers}”
    ItemTemplate=”{StaticResource supplierDataTemplate}”
    SelectedValue=”{xcdg:CellEditorBinding}”>
    <ComboBox.Resources>
    <Style TargetType=”Popup”>
    <Setter Property=”TextElement.Foreground”
    Value=”{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}” />
    </Style>
    </ComboBox.Resources>
    </ComboBox>
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    <xcdg:CellEditor.ActivationGestures>
    <xcdg:KeyActivationGesture SystemKey=”Down”
    Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”Up”
    Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”F4″/>
    <xcdg:KeyActivationGesture Key=”Space”/>
    </xcdg:CellEditor.ActivationGestures>
    </xcdg:CellEditor>

    <!–A data template that will be used to represent a category with its name–>
    <DataTemplate x:Key=”categoryDataTemplate”>
    <TextBlock Text=”{Binding CategoryName}”
    TextTrimming=”{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type xcdg:Cell}}, Path=ParentColumn.TextTrimming}”
    TextWrapping=”{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type xcdg:Cell}}, Path=ParentColumn.TextWrapping}”/>
    </DataTemplate>

    <!–A cell content template that will be used to represent a CategoryID with its name–>
    <DataTemplate x:Key=”categoryCellDataTemplate”>
    <local:CategoryIDDictionary Key=”{TemplateBinding Content}”
    MinHeight=”22″

    Imported from legacy forums. Posted by Dennis (had 1292 views)

    Xceed Support
    Member
    Post count: 5658

    Visual Studio 2005 has limited design-time support for Windows Presentation Foundation (WPF); therefore, it is not always possible to have a WPF control—including Xceed DataGrid for WPF—in the toolbox and then add it to a form and have an easy development experience like the one that is available with Windows Forms. Full WPF design-time support will be available in Visual Studio “Orcas”.

    For the moment, Xceed DataGrid for WPF can only be used in XAML, C#, or VB.NET.

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

    User (Old forums)
    Member
    Post count: 23064

    The WPF designer in VS2005 isn’t very mature, you’ll see “Whoops!” a LOT.

    VS2008 (a.k.a Orcas) Beta 2 has a designer that works a lot better, but it’s not perfect either. But Beta 2 is less stable than VS2005, nonetheless, I choose to work in VS2008 Beta 2 all day (save work often) :).

    VS2008 Beta 2 has some bugs of course, the one that is most noticeable to me is that Popups have display problems in some situations. This can affect a lot of your work depending on what you do (see https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=290874).

    For my Vista dev box running the DataBinding sample built with VS2008 Beta 2, I also only see GRAY and WHITE, except for the “Group By” row that shows up for “DataTable as source” is Dark Greenish.

    *** Another issue with VS2008 Beta 2:
    *** When binding to DataGridCollectionViewSource objects created in XAML,
    *** it’s necessary to set the path in the binding to “View”. For example:
    *** ItemsSource=”{Binding Source={StaticResource cvsEmployees}, Path=View}”

    Review the following excerpt of a MODIFIED version of MainPage.xaml in the CustomViews sample for more context.

    Have fun,
    Richie

    <code>

    <xcdg:DataGridCollectionViewSource x:Key=”cvsEmployees”
    Source=”{Binding Source={x:Static Application.Current},Path=Employees}”>
    <xcdg:DataGridCollectionViewSource.SortDescriptions>
    <compModel:SortDescription PropertyName=”LastName”/>
    </xcdg:DataGridCollectionViewSource.SortDescriptions>
    </xcdg:DataGridCollectionViewSource>

    <xcdg:DataGridControl x:Name=”grid”
    ItemsSource=”{Binding Source={StaticResource cvsEmployees}, Path=View}”

    </code>

    Imported from legacy forums. Posted by Richard (had 374 views)

    User (Old forums)
    Member
    Post count: 23064

    I should be more clear…. I understand from MS the VS2005 WPF designer has been frozen, it will not be improved further.

    All the efforts in this area are in getting VS2008 released. I believe the RTM is scheduled for the fall or early 2008, but I’m not sure.

    I’ve read elsewhere VS2008 Beta 2 has “Go Live” license, so it’s getting there. If you decide to move your dev to VS2008, do so carefully 🙂 I use it on a dedicated 2nd dev box… the VS2005 is still safe and sound and on another machine.

    Imported from legacy forums. Posted by Richard (had 4045 views)

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