Data not refreshing in datagrid

Hello,

I'm facing a lot of troubles with the datagrid... I need to format the content my columns based on a picker, whenever it's currency I must switch to C2, otherwise it will be N0 format.

My XAML
               
                   
                       
                            Margin="8,0"
                            Text="{Binding Path=BindingContext.MonthHeaders[1], Source={x:Reference rootView}}"
                            XAlign="End"
                            YAlign="Center" />
                   
               

               
                   
                       
                            Margin="8,0"
                            Text="{Binding D02, StringFormat='{}{0:N0}'}"
                            XAlign="End"
                            YAlign="Center">
                           
                               
                                    Binding="{Binding Path=BindingContext.IsCurrency, Source={x:Reference rootView}}"
                                    TargetType="Label"
                                    Value="True">
                                   
                               

                               
                                    Binding="{Binding D02, Converter={StaticResource doubleIsZeroOrLessConverter}}"
                                    TargetType="Label"
                                    Value="True">
                                   
                               
                           
                       
                   
               
           

I have 30 columns like that with D1...D30 MappingName. The problem is that when I change to C the first time, every time I switch back to IsCurrency = false the data is not changing anymore. Datagrid always showme the same data over and over but if I switch to IsCurrency = true it shows the correct amount.

Edit: I switched the triggers order and now the N0 format is working fine but the C2 not. Seems that it only respect the last format option.

2 Replies

JC Juan Carlos Gonzalez Salazar replied to Juan Carlos Gonzalez Salazar February 27, 2018 01:37 AM UTC

Hello,

I'm facing a lot of troubles with the datagrid... I need to format the content my columns based on a picker, whenever it's currency I must switch to C2, otherwise it will be N0 format.

My XAML
               
                   
                       
                            Margin="8,0"
                            Text="{Binding Path=BindingContext.MonthHeaders[1], Source={x:Reference rootView}}"
                            XAlign="End"
                            YAlign="Center" />
                   
               

               
                   
                       
                            Margin="8,0"
                            Text="{Binding D02, StringFormat='{}{0:N0}'}"
                            XAlign="End"
                            YAlign="Center">
                           
                               
                                    Binding="{Binding Path=BindingContext.IsCurrency, Source={x:Reference rootView}}"
                                    TargetType="Label"
                                    Value="True">
                                   
                               

                               
                                    Binding="{Binding D02, Converter={StaticResource doubleIsZeroOrLessConverter}}"
                                    TargetType="Label"
                                    Value="True">
                                   
                               
                           
                       
                   
               
           

I have 30 columns like that with D1...D30 MappingName. The problem is that when I change to C the first time, every time I switch back to IsCurrency = false the data is not changing anymore. Datagrid always showme the same data over and over but if I switch to IsCurrency = true it shows the correct amount.

Edit: I switched the triggers order and now the N0 format is working fine but the C2 not. Seems that it only respect the last format option.

Please find attached my XAML

Attachment: xaml_b347d634.zip


SS Sivaraman Sivagurunathan Syncfusion Team February 27, 2018 12:27 PM UTC

Hi Juan, 
 
Thanks for using syncfusion support. 
 
We have checked your query. Currently we do not provide the support for runtime changes in GridColumn.Format. we will consider this in future. 
 
Regards, 
Sivaraman  


Loader.
Up arrow icon