Home Forums WPF controls Xceed DataGrid for WPF How to make cell editable.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #22600 |

    I am binding a DataTemplate to the CellContentTemplate.
    My DataTemplate contains a TextBox whose Text property is binded to the ‘LastName’ property of the DataSource object.
    Problem is that all the appeared TextBoxes are empty. Data is not Bounded to them. Here is my source code.

    <DataTemplate x:Key=”editableCellContentTemplate”>
    <TextBox Text=”{Binding Path = LastName, Mode= Default }”/>

    <DockPanel LastChildFill=”True”>
    <StackPanel DockPanel.Dock=”Top”>
    <Button x:Name=”btnPopulateGrid”>Populate</Button>
    <xcdg:DataGridControl x:Name=”exceedGrid”
    ItemsSource=”{Binding Path=GridDataSource, ElementName=exceedGridForm, Mode=Default}”>

    <xcdg:Column FieldName=”LastName”
    CellContentTemplate=”{StaticResource editableCellContentTemplate}”/>


    Imported from legacy forums. Posted by Rajesh Prajapati (had 1956 views)

    Xceed Support
    Post count: 5658

    When you are specifying in the Column definition that the FieldName is LastName, then the value of the Cell’s for this column will have the LastName as their content… Therefore, you need not to provide the “LastName” path in the CellContentTemplate:

    Try this:

    <DataTemplate x:Key=”editableCellContentTemplate”>
    <TextBox Text=”{Binding}”/>

    Imported from legacy forums. Posted by Marcus [Xceed] (had 2939 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.