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
Count row with the same color


i would like to count the total of row with  the same color inside a XamdataGrid ;

i use this code in Xaml 

                        <Style TargetType="{x:Type igDP:DataRecordCellArea}">
                                <DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self},  Path= Record.Cells[0].Value, Converter={StaticResource nullconvertor}}"  Value="{x:Null}">
                                    <Setter Property="Background" Value="#FFFF4600"></Setter>

Then i would calculate the total of row with this color "#FFFF4600".

Do you have any suggestion about that?


  • 5315
    Offline posted

    Hello ,

    Thank you for posting to our forum.

    I am not sure if I understand your requirement correctly.
    If you are asking to count the numbers of row of particular color then you can achieve it using the same mechanism which you are using to set the color to any of the row.

    Means when you are applying the color to the grid rows , you much have made some condition check for that , here only you can count the number of the rows succeeding with that condition check.

    Otherwise we do not have direct property in the grid to count the number of rows having some color, you should have your own logic to achieve the same.