Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
325
Grid rendering issue
posted

We are using Xamgrids for displaying large number of rows, now the problem is with conditional formatting  and FormatString .

 

We have applied conditional formatting like negative value should be displayed in red   and format function of textcolumn to display a decimal up to certain decimal places

 

Now if I scroll from top to bottom, I can see negative numbers without red font and text columns without formatted decimal places data

 

This problem goes away if I move scroll bar and take particular row in and out of focus

 

Could you please explain the behavior described above and propose a solution?

 

Vikram

  • 20
    posted

    I think you grid is virtualized. Try to change the RecordContainerGenerationMode and test the scrolling

    <igWpf:XamDataGrid RecordContainerGenerationMode="LazyLoad"/>

    If the problem is solved with the above change then

          1. Remove the RecordContainerGenerationMode.

          2. Define a cellvaluepresenter style for that field.

                        <Style x:Key="CheckCellValuePresenterStyle" TargetType="{x:Type igDp:CellValuePresenter}" BasedOn="{StaticResource GeneralCvpStyle}">

                            <Setter Property="Template">

                                <Setter.Value>

                                    <ControlTemplate>

                                        <igEditors:XamNumericEditor Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}"

                                                                  Style="{DynamicResource ToggleCheckEditorStyle}" Margin="1,2,1,2" Padding="0"/>

                                    </ControlTemplate>

                                </Setter.Value>

                            </Setter>

                        </Style>

          3. Assign this cellvaluepresenter style to the field having the issue.

    I hope this will help

    Thanks,

    Ishraque Tanveer Khan

  • 27093
    posted

    Hello Vikram,

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

    If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.

  • 27093
    posted

    Hello Vikram,

     

    I have been looking into your issue and the behavior you describe is familiar. This usually happens when you have not set your ShouldRefreshOnDataChanged to True, or when your underlying object does not implement INotifyPropertyChanged. In such cases there is nothing to update the evaluate method of the rule for the new value, however when you scroll up and down the XamGrid’s virtualization kicks in, which actually reuses the cells visual elements. This is done in order to drastically improve performance, by generating visuals only for the visible cells. This results in reloading the cells when they move into view and the  condition is recheck and the evaluate method of the rule is executed and sets the StyleToApply style.

     

    Hope this clarifies things. Please let me know if I can be of any further assistance on the matter.