This project has moved and is read-only. For the latest updates, please go here.

edit Datetimepicker in datagrid.

Aug 12, 2011 at 3:37 PM


I got a problem when editing the datetime value in the datagrid cell.

for example, if I edit the "name" column, and would show different value.

however, when I edit the log_time column, always show the original loaded value.

anyway to set the item value change by editing the datatimepicker directly in the datagrid cell?



            <DataGridTextColumn IsReadOnly="False"   Header="name"     Binding="{Binding name}" />
                 <DataGridTemplateColumn IsReadOnly="False"  Header="log_time"
     Width="105" CanUserSort="True">
                            <extToolkit:DateTimePicker    Value="{Binding log_time,Mode=TwoWay}"  Format="Custom" FormatString="hh:mm:ss"/>


Aug 12, 2011 at 5:20 PM

Try using it as the cell editing template.  When it is used as the CellTemplate, the DatGrid is not in edit mode.  The DataGrid will go into edit mode when the cell editing template becomes available.

Aug 12, 2011 at 5:27 PM

Or you can simply use the UpdateSourceTrigger as follows:

                        <extToolkit:DateTimePicker Value="{Binding Date, UpdateSourceTrigger=PropertyChanged}"  Format="Custom" FormatString="hh:mm:ss"/>