Hi!

Im managing a WPF application that has a very inconsistent UI. Now the customer want to streamline it a bit, and I have stumbled upon a problem with several of the datagrids.

it seems, as for some cells, they use a simple DataGridTextColumn and bind the text value right from the model item. And on some cells they override the template for the cell and add their own kind of textbox, like this:

Code:
  <DataGridTemplateColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <MainViews:SuperStringTextBox 
                                                            Text="{Binding MyRow.Text}"
                                                            AllowWidgetReferences="True"
                                                            IsReadOnly="{Binding Path=IsReadOnly, ElementName=testing}">
                                                        </MainViews:SuperStringTextBox>
                                                    </DataTemplate>
                                                </DataGridTemplateColumn.CellTemplate>
The above ie basically a textbox but also allow drag/drop and will then display a value as a rectangle with an x for close.

Anyway, now the customer say that they want the DEFAULT cell behaviour (edit with double click and F2 etc) for all textboxes, standard or custom. Is there any "simple" way to do this, or do I have to implement these features manually for each and every one of these cell templates (about 5 of them)? So far I have identified 4 things that I need to take care of:

* The textbox is a textblock when not in edit mode, hence the selected row color is the same

* when the cell is selected and press f2, the cell switches to textbox

* when double click the cell switches to textbox

* when cell is selected and typing starts, everything is overwritten.

kind regards
S