This is a migrated thread and some comments may be shown as answers.

Multiple DataFormatString for columns

0 Answers 17 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
ShinichiKudo asked on 24 Jul 2015, 08:37 AM


I have Multiple  ​Format String for columns. I want to binding Multiple  ​DataFormatString for columns. But it doesn't work. 

My source:


<telerik:RadGridView Name="GridWatchPriceTable"  ItemsSource="{Binding ModelData.LstFeeTable}" Style="{DynamicResource GridViewCustomStyle}" 
                                 IsReadOnly="False" >


   <telerik:GridViewDataColumn DataMemberBinding="{Binding HighPrice}" 
                                                 DataFormatString="{Binding NumberDecimalString}"                                                
                                                Header="{StaticResource ListFeeTable_High}" TextAlignment="Right" IsReadOnly="True"/>



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!



No answers yet. Maybe you can help?

Asked by
Top achievements
Rank 1
Share this question