<data:datagridtemplatecolumn header="leave a message to the author"> <data:DataGridTemplateColumn.CellTemplate> <DataTemplate> <textblock text="{Binding SendMessage}"/> </DataTemplate> </data:DataGridTemplateColumn.CellTemplate> <data:DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <textbox text="{Binding Sendmessage,mode=twoway}"/> </DataTemplate> </data:datagridtemplatecolumn.celleditingtemplate > </data:DataGridTemplateColumn>
Through this case, we can see
Mode=oneway, changes to the data object can affect the DataGrid row, and modifying the data in the DataGrid row does not affect the data object
Mode=onetime, the data object change does not affect the DataGrid row, and modifying the data in the DataGrid row does not affect the data object
Mode=twoway, data object changes can affect the DataGrid row, and modifying data in the DataGrid row can affect the data object
If you have an edit template when you double-click the row, the data will be retrieved from the data object.
Silverlight DataGrid control Column Binding Properties note