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

Conditional formatting - changing font style to BOLD

Thread ID:

Created:

Updated:

Platform:

Replies:

108605 May 1,2013 04:19 PM UTC Jan 9,2014 03:23 AM UTC WPF 3
loading
Tags: GridControl
Swati Juneja
Asked On May 1, 2013 04:19 PM UTC

Hi, 

I am trying to add conditional formatting on the entire row whenever certain column value changes using GridDataStyleInfo. Weird thing is sometimes only one cell font changes and sometimes entire row font changes. I want to change the entire row font whenever certain column value in that row changes. 
Below is the code

   <syncfusion:GridDataControl.ConditionalFormats>
                        <syncfusion:GridDataConditionalFormat Name="C1" >
                            <syncfusion:GridDataConditionalFormat.Style>
                                <syncfusion:GridDataStyleInfo>
                                    <syncfusion:GridStyleInfo.Font>
                                        <syncfusion:GridFontInfo  FontWeight="Bold" />
                                    </syncfusion:GridStyleInfo.Font>                                                                                                   </syncfusion:GridDataStyleInfo>
                            </syncfusion:GridDataConditionalFormat.Style>
                            <syncfusion:GridDataConditionalFormat.Conditions>
                                <syncfusion:GridDataCondition ColumnName="SecurityfacilityList.IsDirty" ConditionType="Equals" Value="true" />
                                <syncfusion:GridDataCondition ColumnName="HasModifications" ConditionType="Equals" Value="true" />
                            </syncfusion:GridDataConditionalFormat.Conditions>

Please help !! 

Thanks
Swati


Divya A [Syncfusion]
Replied On May 7, 2013 12:10 PM UTC

Hi Swati,

 

We have analyzed your query, the reported issue occurs when the row is not properly refreshed. You can overcome this by enabling the RefreshWholeRow Property as in the following code snippet.

 

Code Snippet:

 

 this.SyncGrid.Model.RefreshWholeRow = true;
 

Please let us know if you have any concern.

 

Regards,

Divya.


Permjeet Pandha
Replied On January 6, 2014 04:50 PM UTC

I'm trying to do something similar using sfGrid on WinRT.

I have a dropdown column which offers a number of choices.
I want the row to change colour according to the dropdwn choice.
I have set up the RowStyleSelector and checked it gets called when the grid is first drawn.
My dropdown is selected and a new value chose for a row.
At this point I would expect to be able to refresh the grid to reapply the styles but I
cannot find a way to do it. I tried to do as you suggested in the previous reply:

     this.dataGrid.Model.RefreshWholeRow();

but the the dataGrid does not have a Model property. Here's some code fragments. Can you suggest a way to achieve this?

Thanks

Permjeet

<UserControl
    x:Class="CGI.xxx"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:storeApps="using:Microsoft.Practices.Prism.StoreApps"
    xmlns:notification="using:Syncfusion.UI.Xaml.Controls.Notification"
    xmlns:grid="using:Syncfusion.UI.Xaml.Grid"

    xmls:local="xyz"
    mc:Ignorable="d">
   

<UserControl.Resources>
        <ResourceDictionary>
            <local:IncludeTypes x:Key="includeTypesComboBox" />
            <local:CustomRowStyleSelector x:Key="rowStyleSelector" />
        </ResourceDictionary>
    </UserControl.Resources>
   
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <grid:SfDataGrid x:Name="dataGrid" AllowSorting="True" AllowEditing="True" NavigationMode="Cell" EditTrigger="OnTap"
                         ShowRowHeader="True" ItemsSource="{Binding Entities}"
                         SelectionMode="Single"  Grid.Row="1"
                         RowStyleSelector="{StaticResource rowStyleSelector}"
                         behaviours:DataGridCurrentCellEndEditCommandBehaviour.Command="{Binding CurrentCellEndEditCommand}">
            <grid:SfDataGrid.SortColumnDescriptions>
                <grid:SortColumnDescription ColumnName="Name" />
            </grid:SfDataGrid.SortColumnDescriptions>
            <grid:SfDataGrid.Columns>
                <grid:GridTextColumn HeaderText="Name" MappingName="Name" />
                <grid:GridComboBoxColumn ItemsSource="{StaticResource includeTypesComboBox}" MappingName="Include"/>
            </grid:SfDataGrid.Columns>
        </grid:SfDataGrid>
    </Grid>
</UserControl>

The class:
    public sealed partial class zzz: UserControl
    {
        public zzz()
        {
            this.InitializeComponent();
            this.dataGrid.Model.RefreshWholeRow();        }
    }



Narayanasamy J [Syncfusion]
Replied On January 9, 2014 03:23 AM UTC

Hi Permjeet,

 

Thanks for the updates,

 

We have analyzed your queries. We have prepared a simple sample based on your requirement and it can be downloaded from following location.

 

Sample: RowStyle.zip

 

Please let us know if you need further assistance.

 

Regards,

Narayanasamy


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

;