EDIT: I'm open to another approach. The source data is XML, but there's surely other ways to get the datagrid behaving.
This answer got me started, but things seem to be different within a DataGrid. The code works fine if I leave out the value converter, but if I put in the value converter, all I receive as input are empty strings.
Good but imperfect:
<DataGridTextColumn
Header="Length"
Binding="{Binding XPath=length/@value}}" />
Junk:
<DataGridTextColumn
Header="Length"
Binding="{Binding XPath=length,
Converter={StaticResource valueFormattingConverter }}" />
I have a theory that the above is giving me the element content for element ./length (it's an empty element), but I actually want the element ./length because the attributes need to be processed.
Good but for combo boxes:
<ComboBox Style="{StaticResource ComboButtonStyle}" Width="200"
Text="{Binding Path=., Converter={StaticResource valueFormattingConverter }}"
IsEditable="True" />
So with the Combo example, valueFormattingConverter.Convert gets called with an XmlElement (yay!). With the DataGridTextColumn example, it's called with an empty string.
EDIT: ongoing research points to IMultiValueConverter as something I might want.