Adding xamColorPicker to Your Grid

Before You Begin

The xamColorPicker™ control is a simple editor control that allows your end users to select a color value from a pre-defined palette of colors.

What You Will Accomplish

This topic will demonstrate how to add a xamColorPicker control to your DataGrid control using XAML.

Follow These Steps

  1. Create a WPF project.

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

    1. InfragisticsWPF.dll

    2. InfragisticsWPF.Controls.Editors.XamColorPicker.dll

    3. InfragisticsWPF.Controls.Editors.XamSlider.dll

  1. Add the following namespace declarations for xamColorPicker and Windows.Controls:

    In XAML:

  1. Add a DataGrid Control to your page. Set the following:

    1. x:Name - MyDataGrid

    2. In the Columns collection add a template column

    3. In the DataTemplate add a xamColorPicker control with Width - 40

    In XAML:

    <msd:DataGrid x:Name="MyDataGrid" AutoGenerateColumns="True">
        <msd:DataGridTemplateColumn CanUserSort=">
              <ig:XamColorPicker x:Name="MyColorPicker"
                                 Width="40" />
  1. You can bind the property SelectedColor to the appropriate path of your DataGrid’s data source.