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.
Unfortunately, activation email could not send to your email. Please try again.

How can I add a SparkLine column to a SfDataGrid?

Thread ID:

Created:

Updated:

Platform:

Replies:

124397 Jun 7,2016 07:01 AM Jun 8,2016 04:40 AM WPF 1
loading
Tags: SfDataGrid
IL
Asked On June 7, 2016 07:01 AM

For example, I have a class named "Row":
public class Row
{   
    public string Name { get; set; }
    public ObservableCollection<double> DataPoints { get; set; }
}
I want to display multiple rows in SfDataGrid. Each row should contain a SparkLine to display DataPoints. How can I bind it in XAML?

Jai Ganesh S [Syncfusion]
Replied On June 8, 2016 04:40 AM

Hi Ivan, 
 
You can add the SparkLine inside the GridTemplateColumn in SfDataGrid like below, 
 
<syncfusion:GridTemplateColumn MappingName="EmployeeGrade" Width="150" > 
                    <syncfusion:GridTemplateColumn.CellTemplate> 
                        <DataTemplate> 
                            <Grid> 
                                <syncfusion:SfLineSparkline ItemsSource="{Binding EmployeeGrade}"  MarkerVisibility="Visible" 
                                                               Padding="4" YBindingPath="GradePercentage"> 
 
                                </syncfusion:SfLineSparkline> 
                            </Grid> 
                        </DataTemplate> 
                    </syncfusion:GridTemplateColumn.CellTemplate> 
 </syncfusion:GridTemplateColumn> 
 
 
Screen Shot: 
 
 
Regards, 
Jai Ganesh S 


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.

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.

;