Custom WPF DataGrid

Nov 26, 2009 at 6:48 AM

Dears,

I want to create a custom WPF DataGrid, however if I use a user control to wrap a datagrid inside it.

A lot of functions cannot be exposed to the parent.

For example, I cannot expose the columns of datagrid to the parent since it is a read-only field.

Even I expose this property to the parent and I can define something like
<my:AdvancedDataGrid>
    <my:AdvancedDataGrid.DataGrid.Columns>

    </my:AdvancedDataGrid.DataGrid.Columns>
</my:AdvancedDataGrid>

Within <my:AdvancedDataGrid.DataGrid.Columns>, I cannot do anything about declaring template columns like

<my:AdvancedDataGrid>
    <my:AdvancedDataGrid.DataGrid.Columns>
        <my:AdvancedDataGrid.DataGridTemplateColumn> ...
    </my:AdvancedDataGrid.DataGrid.Columns>
</my:AdvancedDataGrid>

If I want to create a custom datagrid and expose the template column property to the parent.
How can I do?

Thanks for answering my question.

Calvin