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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CellStyleSelector on Realtime application

Thread ID:

Created:

Updated:

Platform:

Replies:

117097 Aug 11,2014 10:04 AM UTC Aug 12,2014 11:09 AM UTC WPF 1
loading
Tags: SfDataGrid
Ruby
Asked On August 11, 2014 10:04 AM UTC

We have a real-time application that the style of a cell will depend on the value on the other cell on the same row.

Thus, we try to use the CellStyleSelector to help update the cell style on real time.

The styles are applied correctly during the Grid Initialization, however, when the data are updating, we expect the cell style will be changed accordingly, but it doesn't.

The attachment is a project to reproduce the issue.
In the project, we expect that when Change >=0, we will apply Bold to the Symbol cell.

Attachment: PerformanceDemo_4d0f3818.rar

Farjana Parveen Ayubb [Syncfusion]
Replied On August 12, 2014 11:09 AM UTC

Hi Antony,

 

Thank you for contacting Syncfusion Support.

 

We analyzed your query. You can achieve your requirement by using the Converter for changing the Symbol column weight to Bold while Changing>=0.

 

Please refer the following code snippet and sample in the following location:

 

Code Snippet(XAML) :

<syncfusion:GridTemplateColumn MappingName="Symbol" TextAlignment="Left"                                                                           CellStyleSelector="{StaticResource stockCellStyleSelector}" UpdateTrigger="PropertyChanged">

                                <syncfusion:GridTemplateColumn.CellTemplate>

                                   <DataTemplate>

                                        <TextBlock FontWeight="{Binding Change, Converter={StaticResource changefontweight}}"

                                                   Text="{Binding Symbol}"/>

                                    </DataTemplate>

                                </syncfusion:GridTemplateColumn.CellTemplate>

                            </syncfusion:GridTemplateColumn>

 

Code Snippet(C#):

internal class ChangeFontWeight : IValueConverter

    {

        object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo info)

        {

           if(Convert.ToInt32(value)>=0)

                return FontWeights.Bold;

            else

                return FontWeights.Normal;

        }

 

        object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo info)

        {

            throw new NotImplementedException();

        }

    }

 

 

Regards,

Farjana Parveen A

 


Attachment: PerformanceDemo_6d58be84.zip

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.

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

;