Home Forums WPF controls Xceed DataGrid for WPF How can i bind dataset or datasource to xceed grid ?

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

    can anybody please tell me that how can i bind dataset or datasource to xceed grid ? using xaml.

    Imported from legacy forums. Posted by deeps (had 10499 views)

    User (Old forums)
    Member
    Post count: 23064

    DataSet ds = new Dataset();
    grdExceed.ItemsSource = ds.Tables[TableName].DefaultView;

    Imported from legacy forums. Posted by rajendernag (had 1915 views)

    User (Old forums)
    Member
    Post count: 23064

    can u please give me the xml part for this ……………….

    Dim grd As New Xceed.Wpf.DataGrid.DataGridControl
    and will u please tell me that above declaration is correct or not.

    Imported from legacy forums. Posted by deeps (had 1960 views)

    Xceed Support
    Member
    Post count: 5658

    Loading of a DataSet/DataTable from a DataBase in XAML is not something that can be done (or at least its not something that is well documented).

    I still suggest loading the data in the DataSet/DataTable in the code-behind of your application.

    To get an example of how to load data in code-behind and access it in XAML, you can take a look in the SolidFoundation sample (provided in both C# and VB.NET as well as their XAML counterpart), located in the “Samples” sub-folder of the “Xceed DataGrid for WPF 1.0” folder.

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

    User (Old forums)
    Member
    Post count: 23064

    i have added reference of xceed grid in my project but i have not got the xceed grid in my toolbar. for this reason i am unable to add grid in my project through toolbar. so will you please help me……

    Imported from legacy forums. Posted by deeps (had 1728 views)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    Since the designer (cider) for WPF is still in the CTP stage, we did not do any work to integrate to the toolbox for it.

    To add the DataGridControl to the Page/Window, you need to access the XAML code and use the statement

    <xcdg:DataGridControl/>

    I advise referring to the samples and the documentation (which are all using XAML and/or code) for further help about using the DataGridControl control. Particularilly, I suggest browsing the How-To.

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

    User (Old forums)
    Member
    Post count: 23064

    Hi Sir,
    I have used the tag <xcdg:DataGridControl> but sir i go the error as
    1. Namespace Prefix ‘xcdg’ is not defined
    2. The element ‘Grid’ in namespace ‘http://http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8217; has invalid child element ‘DataGridControl’ …………

    My XAML File is
    <Page x:Class=”Page1″
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;
    Title=”Page1″>
    <Grid>
    <xcdg:DataGridControl>
    </xcdg:DataGridControl>
    </Grid>
    </Page>

    Imported from legacy forums. Posted by deeps (had 1781 views)

    Xceed Support
    Member
    Post count: 5658

    Before being able to use elements from namespaces other than those defined the default namespace (xmlns statement in your snippet), you need to add a xmlns:xyz statement that maps to the desired namespace.

    You can refer to the documentation for the DataGridControl (under “Gettting Started”, then “Installation Instruction” ) for additional details on how to setup your projects for use with the DataGridControl.

    <a href=”http://doc.xceedsoft.com/products/XceedWpfDataGrid/Installation%20Instructions.html”>Here is a convenient link that maps to this article.</a>

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

    User (Old forums)
    Member
    Post count: 23064

    my code is

    <Window x:Class=”demoXceed.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:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid&#8221;
    Title=”demoXceed” Height=”450″ Width=”600″>
    <xcdg:DataGridControl x:Name=”playersGrid” ItemsSource=”{Binding}” DisplayMemberPath=”Players”/>
    </Window>

    still i am getting the error for <xcdg:DataGridControl>

    The Error is “The Element ‘Grid’ in namespace ‘http://’&#8230;
    the same error ehich i have posted earlier…
    can u please tell me dat is it necessary to add xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid&#8221; in ‘App.xaml’ file……

    and one more thing When i tried to add xmlns:xcdg in xaml file i got the list of schema’s like ‘http://schemas&#8230;.’ but i have not found the xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid&#8221;
    schema in that list… can u please help me…..

    Please tell me my following code is correct or not after the above demoXceed.Window1.xaml file

    my code in demoXceed.Window1.vb is

    string connString = string.Format(“server=(local);Initial Catalog=testing;uid=sa;pwd=ventive;”);
    SqlConnection conn = new SqlConnection(connString);
    conn.open()
    DataSet dataSet = new DataSet();
    SqlDataAdapter playersAdapter = new SqlDataAdapter();
    playersAdapter.SelectCommand = new SqlCommand(“Select Number, Name, Position, Age, Club from Players;”, conn);
    playersAdapter.Fill(dataSet, “Players”);
    playersGrid.DataContext = dataSet.Tables[“Players”];

    Imported from legacy forums. Posted by deeps (had 9938 views)

    User (Old forums)
    Member
    Post count: 23064

    plz help,
    can i add link button or can i display first column as link column. so that after clicking on that link column i can populate some form or something else….. is it possible in xceed grid…… i want to do the master details relationship………….

    Imported from legacy forums. Posted by deeps (had 2052 views)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    You can change the TitleTemplate property of the Column which you want to display whatever control you need. You should then be able to perform any action you need.

    Alternately, you can change the ControlTemplate of the ColumnManagerCell by using an Implicit Style.

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

    User (Old forums)
    Member
    Post count: 23064

    I have added the button control on first column of grid and i want the information of that column which i have clicked the button…..

    Imported from legacy forums. Posted by deeps (had 1952 views)

    User (Old forums)
    Member
    Post count: 23064

    how to clear the xceed datgrid control…….

    Imported from legacy forums. Posted by deeps (had 2224 views)

    User (Old forums)
    Member
    Post count: 23064

    How can i give paging in xceed datagrid control… is paging is possible?

    Imported from legacy forums. Posted by deeps (had 2094 views)

    User (Old forums)
    Member
    Post count: 23064

    // this is part of the application code behind class
    public DataTable MassGrid
    {
    get
    {
    return GetDataSet().Tables[“MassGrid”];
    }
    }

    public static DataSet GetDataSet()
    {
    DataSet set = new DataSet(“Set1”);
    DataTable massGridTable = set.Tables.Add(“MassGrid”);
    massGridTable.Columns.Add(“Q1 Mass”, typeof(double));
    massGridTable.Columns.Add(“Q3 Mass”, typeof(double));
    massGridTable.Columns.Add(“Dwell Time”, typeof(double));

    for (int i = 0; i < 7; i++)
    {
    DataRow dataRow = massGridTable.NewRow();
    dataRow[“Q1 Mass”] = (double)i;
    dataRow[“Q3 Mass”] = 0.0;
    dataRow[“Dwell Time”] = 0.0;
    massGridTable.Rows.Add(dataRow);
    }
    set.Locale = new CultureInfo(“en-US”);
    return set;
    }

    to use, set this in the Xaml
    <xcdg:DataGridControl x:Name=”grid”
    ItemsSource=”{Binding Source={x:Static Application.Current},Path=MassGrid}” >

    Imported from legacy forums. Posted by Friedrich (had 2041 views)

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