We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to show a databar in the background of a cell?

Thread ID:

Created:

Updated:

Platform:

Replies:

149391 Nov 25,2019 09:01 AM UTC Nov 26,2019 01:01 PM UTC WPF 1
loading
Tags: SfDataGrid
Sascha
Asked On November 25, 2019 09:01 AM UTC

Hi Syncfusion Team!
We are currently trying to display a databar in the background of a column in wpf sfdatagrid while a value is in the foreground. We want to achieve a similar representation as it is possible in Excel.

Here is an excel example.
Is this possible? If so, how?
And, additionally asked, can we also create horizontally stacked bars?
kind regards,
Sascha

Mohanram Anbukkarasu [Syncfusion]
Replied On November 26, 2019 01:01 PM UTC

Hi Sascha,   
  
Thanks for contacting Syncfusion support.    
  
Query   
Solution   
We are currently trying to display a databar in the background of a column in wpf sfdatagrid while a value is in the foreground. We want to achieve a similar representation as it is possible in Excel.   
  
Here is an excel example.   
Is this possible? If so, how?   
You can achieve this by using GridTemplateColumn with ProgressBar and TextBlock as DataTemplate as shown in the below code example.   
  
Code example:    
  
<syncfusion:GridNumericColumn MappingName="Quantity"   
                                      SetCellBoundValue="True"   
                                      NumberDecimalDigits="0">   
    <syncfusion:GridNumericColumn.CellTemplate>   
        <DataTemplate>   
            <Grid>   
                <ProgressBar x:Name="progressBar" Background="Transparent"     
                                     Visibility="Visible" Minimum="0" Maximum="100"      
                                     BorderThickness="0" Value="{Binding Path=Value}" />   
                <TextBlock  Text="{Binding Path=Value}" HorizontalAlignment="Right"   
                                    VerticalAlignment="Center" TextAlignment="Center"/>   
            </Grid>   
        </DataTemplate>   
    </syncfusion:GridNumericColumn.CellTemplate>   
</syncfusion:GridNumericColumn>   
  
     
  
We have prepared a sample using the above code example and it is available in the below link for your reference.    
  
  
And, additionally asked, can we also create horizontally stacked bars?   
We are not clear with this requirement. Please confirm whether you need to display as shown in the below image.    
  
     
  
Please provide more details about this requirement. It will be helpful for us to analyze and provide a prompt solution at the earliest.   
  
 
Regards,   
Mohanram A  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon