Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
IF the grid value is positive the arrow should be Green in Colour If it is Negative the Arrow Should be Red in Colour.

XML
<DataTemplate x:Key="sellRateStatusIndicator">
           <StackPanel Orientation="Horizontal">
               <dxga:StateIndicatorControl x:Name="arrowStateIndicatorControl" StateIndex="{Binding Path=RowData.Row.SellRateStatus}" Width="20" Height="20">
                   <dxga:StateIndicatorControl.Model>
                       <dxga:ArrowStateIndicatorModel  Background="Gray" Foreground="Aqua"/>
                   </dxga:StateIndicatorControl.Model>
               </dxga:StateIndicatorControl>
               <TextBlock x:Name="txtBlkRecordStatus" VerticalAlignment="Center" Text="{Binding Path=RowData.Row.SellingRate, Mode=OneWay}"></TextBlock>
           </StackPanel>
       </DataTemplate>


<dxg:gridcolumn fieldname="SellingRate" header="Sell Rate" celltemplate="{StaticResource sellRateStatusIndicator}" width="80" xmlns:dxg="#unknown">

What I have tried:

<dxg:gridcolumn fieldname="SellingRate" header="Sell Rate" celltemplate="{StaticResource sellRateStatusIndicator}" width="80" xmlns:dxg="#unknown">
Posted
Updated 18-May-16 20:27pm

1 solution

Hi,
I don't use DevExpress Components.

But take a look about binding with converter:
- Bind like txtBlkRecordStatus the value of Foreground of ArrowStateIndicatorModel using a converter
- create a converter inherit from IConverter that converter Value to Color. ConvrrtBack function is not necessary because you have to use OneWay Mode.

Best regards.
 
Share this answer
 
Comments
SwethaVijayan 25-May-16 7:42am    
thanks. i got the solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900