Automatic EditMode and CellTemplate

2 posts, 0 answers
  1. Heiko
    Heiko avatar
    153 posts
    Member since:
    Oct 2012

    Posted 26 Feb 2015 Link to this post

    Hi!

    When I bind a GridView to an QCV and klick in a cell the cell/row is in edit-mode and I can change the content of the cell. The moment I use a CellTemplate this functionality is gone, no automatic edit-mode, nothing. Here the example which works:

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"
        UniqueName="BoilerplateName"
        IsGroupable="False"
        Width="200"
        Header="Name" />

    This one is not working - no edit-mode whatsoever:

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"
                               UniqueName="BoilerplateName"
                               IsGroupable="False"
                               Width="200"
                               Header="Name">
        <telerik:GridViewDataColumn.CellTemplate>
            <DataTemplate>
                <TextBox Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         AcceptsReturn="True"
                         MaxLength="4000"
                         TextWrapping="Wrap" />
            </DataTemplate>
        </telerik:GridViewDataColumn.CellTemplate>
    </telerik:GridViewDataColumn>



  2. Boris
    Admin
    Boris avatar
    276 posts

    Posted 27 Feb 2015 Link to this post

    Hello Neils,

    The described behavior is an expected one, since you have defined an editor as CellTempate, which represents the view mode of RadGridView. A possible way to go about this is to use the CellEditTemplate property of the desired column, which is the edit mode. For more information about both properties you can refer to the Setting CellTemplate and CellEditTemplate documentation article.

    I hope this helps.

    Regards,
    Boris
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top