Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
How to get cell from DataContext for CellValuePresenter
posted

Hi,

i followed your post to write a custom cell presenter control:

  <igDP:XamDataGrid Name="DataGrid"  >
                <igDP:XamDataGrid.Resources>
                    <Style x:Key="CellStyle" TargetType="{x:Type igDP:CellValuePresenter}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">    
                                    <StackPanel Orientation="Horizontal">
                                        <!--<Label Content="{TemplateBinding DataContext}"  Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"></Label>-->
                                        <my:CWpfIgZelleGui
                                            DataContext="{TemplateBinding DataContext}" 
                                            Width="{TemplateBinding Width}"
                                            Height="{TemplateBinding Height}"
                                            />
                                       
                                    </StackPanel>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </igDP:XamDataGrid.Resources>
            </igDP:XamDataGrid>

In the code i set the style and my cell control is displayed.

But the problem is with the datacontext:

The datacontext contains the DataRecord. How should i figure out, which cell to display?

 

 

 

 

 

 

Parents Reply Children