I want to set the p&l column I have to currency, it works well when I have it binded it's easy to set in XAML, but I have inner datagrids that don't use binding so I need to change its format to currency in code behind. How do I do that, here's what I have so far:
private void dataGrid_RowDetailsVisibilityChanged(object sender, ExtendedGrid.Microsoft.Windows.Controls.DataGridRowDetailsEventArgs e)
{
//Get TradeID to query inner table by that trade id
var row = e.Row;
var drv = (DataRowView)row.DataContext;
int TradeID = drv.Row.Field<int>(ColTradeID);
ExtendedGrid.Microsoft.Windows.Controls.DataGrid innerDataGrid = e.DetailsElement as ExtendedGrid.Microsoft.Windows.Controls.DataGrid;
DataTable TableView = null;
//check if tradeid selected already exists
if (selectedRowView.ContainsKey(TradeID))
{
TableView = selectedRowView[TradeID]; //selectedrowview is a dictionary of datatables that stores what to load in itemsource based on a tradeId
innerDataGrid.ItemsSource = ((IListSource)selectedRowView[TradeID]).GetList();
//Format Columns
innerDataGrid.Columns[10].CellStyle = "C"; // **I want currency, this doesn't work,
//I also tried typing defaultcelltype.format and nothing would come up its not available for use**
}
}
Also, I'm using the WPF Extended Datagrid not the WPF built in one.