tags:

views:

108

answers:

3

Is there a way to change the column headers of a SL2 datagrid during databinding? I'm looking for something similar to ASP.net's rowDataBound, I'm looking at _LoadingRow is this the correct event?

+1  A: 

You can bind DataColumns in your XAML

 <data:DataGridTextColumn Header="Latitude" Binding="{Binding lat}"  IsReadOnly="True"  />
Henrik P. Hessel
A: 

Why would you change column headers based on row data. Binding/changing column headers should not be row driven.

Cody C
This should be a comment rather than an answer.
Jeff Yates
A: 

As suggested by rAyt in their answer, you can add bindings to the columns. With an appropriate binding and possibly a value converter, you could use this mechanism to update the headers.

You can also set the DataGrid to auto-generate columns based on the collection data. You may find this a better route. You can also modify the auto-generated columns as described by this MSDN article.

Jeff Yates