Version

Adding xamDataGrid to Your Page

This topic is designed to get you up and running as quickly as possible by describing the basic steps required for adding the xamDataGrid™ control.

  1. Create a Microsoft® Windows® Presentation Foundation Window project.

  1. In the Solution Explorer, add the following references to your project:

    • InfragisticsWPF.dll

    • InfragisticsWPF.Editors.dll

    • InfragisticsWPF.DataPresenter.dll

  1. Add a namespace declaration for xamDataGrid.

    In XAML:

    xmlns:igDP="http://infragistics.com/DataPresenter"

    In Visual Basic:

    Imports Infragistics.Windows.DataPresenter

    In C#:

    using Infragistics.Windows.DataPresenter;
  1. Name the default Grid layout panel in the Window so that you can reference it in the code-behind.

    In XAML:

    <Grid Name="layoutRoot">
    </Grid>
  1. Attach an event handler to the Window’s Loaded event if you are going to add the xamGrid using code-behind.

    In XAML:

    <Window ... Loaded="Window_Loaded" ... >
  1. Create an instance of xamDataGrid. Set the BindToSampleData property to True. This will automatically populate xamDataGrid with sample data so that you can preview the xamDataGrid control without setting up a data source. Add the xamDatgrid in the main grid.

    In XAML:

    <igDP:XamDataGrid Name="xamDataGrid1" BindToSampleData="True" />

    In Visual Basic:

    Private xamDataGrid1 as XamDataGrid
    xamDataGrid1 = New XamDataGrid()
    ' You can data bind your instance of xamDataGrid
    ' instead of using the built in sample data
    xamDataGrid1.BindToSampleData = True
    Me.layoutRoot.Children.Add(xamDataGrid1)

    In C#:

    private XamDataGrid xamDataGrid1;
    xamDataGrid1 = new XamDataGrid();
    // You can data bind your instance of xamDataGrid
    // instead of using the built in sample data
    xamDataGrid1.BindToSampleData = true;
    this.layoutRoot.Children.Add(xamDataGrid1);
  1. Run the project to see the xamDataGrid control populated with sample data.

    creating xamdatagrid in xaml