Hello,
I have Multiple Format String for columns. I want to binding Multiple DataFormatString for columns. But it doesn't work.
My source:
View
<telerik:RadGridView Name="GridWatchPriceTable" ItemsSource="{Binding ModelData.LstFeeTable}" Style="{DynamicResource GridViewCustomStyle}"
IsReadOnly="False" >
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding HighPrice}"
DataFormatString="{Binding NumberDecimalString}"
Header="{StaticResource ListFeeTable_High}" TextAlignment="Right" IsReadOnly="True"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
In ViewModel, I Set value for item in LstFeeTable
private ListPriceTableInfoModel UpdateDataModel(Symbol item, ListPriceTableInfoModel model)
{
model.SymbolId = item.SymbolId;
model.SymbolName = item.ContractName;
var baseSymbolInfo = Operator.Instance.GetBaseSymbolById(item.BaseSymbolId);
if (baseSymbolInfo != null)
{
model.FullName = baseSymbolInfo.FullName;
model.ShortName = baseSymbolInfo.ShortName;
model.BaseSymbolId = baseSymbolInfo.BaseSymbolId;
model.NumberDecimal = baseSymbolInfo.NumbreDecimal;
model.NumberDecimalString = ClientUtils.GetFormatString(baseSymbolInfo,true);
var exchange = Operator.Instance.GetExchangeInfoById(baseSymbolInfo.ExchangeId);
model.Exchange = exchange != null ? exchange.ShortName : "";
}
model.ClosePrice = (decimal)100.6654;
model.OpenPrice = (decimal)100.6654;
model.HighPrice = (decimal)100.6654;
model.LowPrice = (decimal)100.6654;
model.YesterdayClose = (decimal)100.6654;
model.YesterdaySettlement = (decimal)100.6654;
model.TotalVolume = null;
model.NetChg = (decimal)100.6654;
model.NetChgPercent = (decimal)100.6654;
model.VolBid = null;
model.Ask = (decimal)100.6654;
model.VolAsk = null;
model.VolAskOld = null;
model.VolBidOld = null;
model.BidOld = (decimal)100.6654;
model.VolBidOld = null;
model.ClosePriceOld = (decimal)100.6654;
model.LastTrade = (decimal)100.6654;
model.LastTradeOld = (decimal)100.6654;
model.Bid = (decimal)100.6654;
model.BidOld = (decimal)100.6654;
return model;
}
I set property NumberDecimalString with function GetFormatString but it doesn't work. Please Help me
Thank for watching!