Home Forums WPF controls Xceed DataGrid for WPF VS2008 VB Installation Issue

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

    Hi,

    I imagine I’ve done something pretty stupid or omitted to do something blindingly obvious since no one else seems to have ever experienced any problem but I cannot get your samples or the example shown in your installation documentation to work and I would be grateful if you could help me out.

    I’m using VS2008 Beta 2, VB, and the code is as shown below when I tried to do the example; I copied the Nothwind database into a folder called Data and I even put in an imports for the xceed.wpf.datagrid.markup; my references include Xceed.Wpf.Controls, Xceed.Wpf.Datagrid and Xceed.Wpf.ThemePack.1.

    Thanks in anticipation,

    Application.xaml.vb
    Class Application

    ‘ Application-level events, such as Startup, Exit, and DispatcherUnhandledException

    ‘ can be handled in this file.

    Partial Public Class App

    Inherits System.Windows.Application

    Protected Overrides Sub OnStartup(ByVal e As StartupEventArgs)

    Xceed.Wpf.DataGrid.Licenser.LicenseKey = “blanked out by me here”

    MyBase.OnStartup(e)

    End Sub

    End Class

    End Class

    Window1.xaml
    <Window x:Class=”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=”Window1″ Height=”300″ Width=”300″>

    <Grid>

    <Grid xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid”&gt;

    <Grid.Resources>

    <xcdg:DataGridCollectionViewSource x:Key=”cvs_orders”

    Source=”{Binding Source={x:Static Application.Current},

    Path=Orders}”/>

    </Grid.Resources>

    <xcdg:DataGridControl x:Name=”OrdersGrid”

    ItemsSource=”{Binding Source={StaticResource cvs_orders}}”/>

    </Grid>

    </Grid>

    </Window>

    Window1.xaml.vb
    Imports Xceed.Wpf.DataGrid

    Imports Xceed.Wpf.DataGrid.Converters

    Imports Xceed.Wpf.DataGrid.Print

    Imports Xceed.Wpf.DataGrid.Stats

    Imports Xceed.Wpf.DataGrid.ValidationRules

    Imports Xceed.Wpf.DataGrid.Views

    Imports Xceed.Wpf.Controls

    Imports Xceed.Wpf.DataGrid.ThemePack

    Imports Xceed.Wpf.DataGrid.Markup

    Imports System.Data.OleDb

    Imports System.Data

    Class Window1

    Shared Sub New()

    Dim dataSet As New DataSet()

    Dim mdbfile As String = “Data\Northwind.mdb”

    Dim connString As String = String.Format(“Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}”, mdbfile)

    Dim conn As New OleDbConnection(connString)

    Dim adapter As New OleDbDataAdapter()

    adapter.SelectCommand = New OleDbCommand(“SELECT * FROM Orders;”, conn)

    adapter.Fill(dataSet, “Orders”)

    m_orders = dataSet.Tables(“Orders”)

    End Sub

    Public Shared ReadOnly Property Orders() As DataTable

    Get

    Return m_orders

    End Get

    End Property

    Private Shared m_orders As DataTable

    All I end up with is is a Windows Form with the statement in line 1 “Drag a column header here to group by that column.

    Imported from legacy forums. Posted by Jim (had 5641 views)

    Xceed Support
    Member
    Post count: 5658

    Please refer to the FAQ post at the top of the forum for details on how to display the items in VS 2008:

    http://forums.xceed.com/forums/ShowPost.aspx?PostID=6869

    Imported from legacy forums. Posted by Marcus [Xceed] (had 403 views)

    User (Old forums)
    Member
    Post count: 23064

    Since I have no idea where PATH=VIEW has to be specified and there is no reference to “.itemsource” in the example or samples I did not find this terribly helpful.

    Imported from legacy forums. Posted by Jim (had 487 views)

    Xceed Support
    Member
    Post count: 5658

    <xcdg:DataGridControl x:Name=”OrdersGrid”
    ItemsSource=”{Binding Source={StaticResource cvs_orders}, <b>Path=View</b>}”/>

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

    User (Old forums)
    Member
    Post count: 23064

    Many thanks for this and sorry to be so obtuse but I still can’t get it to work.

    I commented out the current relevant line in file window1.xaml and inserted the code you supplied as follows:
    <!–<xcdg:DataGridControl x:Name=”OrdersGrid”
    ItemsSource=”{Binding Source={StaticResource cvs_orders}}”/>–>

    <xcdg:DataGridControl x:Name=”OrdersGrid”
    ItemsSource=”{Binding Source={StaticResource cvs_orders}, Path=View}”/>

    Thanks in advance.

    Imported from legacy forums. Posted by Jim (had 504 views)

    Xceed Support
    Member
    Post count: 5658

    Can you tell me if you see anything in the output window that might indicate a problem?

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

    User (Old forums)
    Member
    Post count: 23064

    No, the build looks good – here’s the output:

    —— Rebuild All started: Project: WpfApplication2, Configuration: Release Any CPU ——
    C:\WINDOWS\Microsoft.NET\Framework\v3.5\Vbc.exe /noconfig /imports:System.Linq,System.Xml.Linq,Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Diagnostics,System.Windows,System.Windows.Controls,System.Windows.Data,System.Windows.Documents,System.Windows.Input,System.Windows.Shapes,System.Windows.Media,System.Windows.Media.Imaging,System.Windows.Navigation /optioncompare:Binary /optionexplicit+ /optionstrict:custom /nowarn:41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 /optioninfer+ /rootnamespace:WpfApplication1 /doc:obj\Release\WpfApplication2.xml /define:”CONFIG=\”Release\”,TRACE=-1,_MyType=\”Custom\”,PLATFORM=\”AnyCPU\”” /reference:”C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll”,”C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll”,”C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll”,”C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll”,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll,”C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll”,”C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll”,”C:\Program Files\Xceed Components\Bin\.NET\Xceed.Wpf.Controls.dll”,”C:\Program Files\Xceed Components\Bin\.NET\Xceed.Wpf.DataGrid.dll”,”C:\Program Files\Xceed Components\Bin\.NET\Xceed.Wpf.DataGrid.ThemePack.1.dll” /debug- /optimize+ /out:obj\Release\WpfApplication2.exe /resource:obj\Release\WpfApplication1.Resources.resources /resource:obj\Release\WpfApplication2.g.resources /target:winexe Application.xaml.vb Window1.xaml.vb Data\NorthwindDataSet.Designer.vb “My Project\AssemblyInfo.vb” “My Project\MyExtensions\MyWpfExtension.vb” “My Project\Resources.Designer.vb” “My Project\Settings.Designer.vb” “C:\Documents and Settings\HP_Administrator\My Documents\Visual Studio 2008\Projects\WpfApplication2\WpfApplication2\obj\Release\Window1.g.vb” “C:\Documents and Settings\HP_Administrator\My Documents\Visual Studio 2008\Projects\WpfApplication2\WpfApplication2\obj\Release\Application.g.vb” “C:\Documents and Settings\HP_Administrator\My Documents\Visual Studio 2008\Projects\WpfApplication2\WpfApplication2\obj\Release\WpfApplication2_Content.g.vb”
    WpfApplication2 -> C:\Documents and Settings\HP_Administrator\My Documents\Visual Studio 2008\Projects\WpfApplication2\WpfApplication2\bin\WpfApplication2.exe
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

    Imported from legacy forums. Posted by Jim (had 547 views)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    After re-reviewing the code you originally sent, I noticed that in the App class, you do not define any data source called “Orders”. That is the reason why you do not see anything in the DataGridControl…

    The faulty statement is:

    <xcdg:DataGridCollectionViewSource x:Key=”cvs_orders”
    Source=”{Binding Source={x:Static Application.Current},
    Path=Orders}”/>

    If you absolutely need to instanciate the data source in the window class, then there is 2 choices available:

    – Instantiate the DataGridCollectionView directly in the Window class and bind the DataGridControl directly without passing through a DataGridCollectionViewSource.

    OR

    – Wait for version 1.3 of the DataGridControl ( due soon ), which will allow using a DataGridCollectionViewSource bound to a non-static reference ( correction of the behavior to align with the original CollectionViewSource ).

    Imported from legacy forums. Posted by Marcus [Xceed] (had 374 views)

    User (Old forums)
    Member
    Post count: 23064

    Thank you for this, I appreciate your assistance. I’ll wait for version 1.3.

    Imported from legacy forums. Posted by Jim (had 7036 views)

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