ComponentOne DataGrid for WPF and Silverlight
In This Topic
    Creating Custom Columns
    In This Topic

    DataGrid for WPF supports creating specific behavior columns. For example you can create a Hyperlink column, a GIF column, a Rich Text column, and so on.

    By creating a custom column you'll be able to customize the cell content and editing content of all the cells belonging to a column, you can even customize the header presenter of the column.

    First, you should add a new class file where the custom column will be written, for example complete the following steps:

    1.   Navigate to the Solution Explorer, right-click the project name and select Add│New Item.

    2.   In the Add New Item dialog box choose Class in the list of templates.

    3.   Name the class, for example "DataGridHyperlinkColumn", and click the Add button to add the class to the project.

    Once the file is created it must inherit from DataGridBoundColumn. Update the class so it appears similar to the following:

    Visual Basic
    Copy Code
    Imports C1.WPF.DataGrid
    Public Class DataGridHyperlinkColumn
        Inherits DataGridBoundColumn
    End Class
    
    C#
    Copy Code
    using C1.WPF.DataGrid;
    public class DataGridHyperlinkColumn : DataGridBoundColumn
    {
    
    }
    

     

    DataGrid for WPF supports creating specific behavior columns. For example you can create a Hyperlink column, a GIF column, a Rich Text column, and so on.