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
Using Template for DataGrid Cell

Can anybody help me?? I'm kind of new at this...

 I have created a template to allow entry into a textbox for a column in my DataGrid (I've included the XAML below.)  Everything works fine when I change the Note column in an existing Row.  The problem I am having is when I try to add a Row. When I type in the Note Column of my add Row (row 1) nothing happens. It doesn't even recognize that I've made an entry in it. I'm I using the wrong template type? Is something wrong with my binding?  Thanks in advance if you can help me.

Here is how I've created the template and then applied it to the DataGrid cell:


<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="NoteTextBox">
    <Setter Property="Template">
            <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                    MinWidth="400" TextWrapping="Wrap"
                    Name="AddNoteTextBox" AcceptsReturn="True" MaxLength="255"
                    Text="{Binding RelativeSource={RelativeSource TemplatedParent},
                    Path=Content, Mode=TwoWay}"
                    AutoWordSelection="True" AcceptsTab="False"> 


<igDP:Field Name="Text" Column="2" Label="Note">
        CellValuePresenterStyle="{StaticResource NoteTextBox}"
        CellClickAction="SelectRecord" />


  • 2320

    Might need some more information. Can you upload a working project that replicates the problem?


    Otherwise, try changing CellClickAction to something like EnterEditModeIfAllowed.