Row color in multiColumnDropDown

Is it possible to change the color of a row in a multColumnDropDown based on a condition? I would like to do this programmatically and in mvvm architecture if possible.
Thanks

1 Reply

JG Jai Ganesh S Syncfusion Team April 20, 2018 12:49 PM UTC

We have loaded the SfDataGrid inside the SfMultiColumnDropDown so you can achieve your requirement to change the color of a row in a SfMultiColumnDropDownControl based on a condition by edit the style of VirtualizingCellsControl like below, 
  <syncfusion:SfMultiColumnDropDownControl.Resources> 
                <local:StyleConverter x:Key="converter"/> 
                <Style TargetType="syncfusion:VirtualizingCellsControl"> 
                    <Setter Property="Background" Value="{Binding Path=Title,Converter={StaticResource converter}}"/> 
                </Style> 
  </syncfusion:SfMultiColumnDropDownControl.Resources> 
class StyleConverter : IValueConverter 
{ 
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
    { 
        if (value.ToString()== "Iron Man 3") 
            return new SolidColorBrush(Colors.Green) { Opacity = 0.7 }; 
        return value; 
    } 
 
    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 
    { 
        return value; 
    } 
    
} 
 
In the above sample, we have change the row color based on the property value. 
We already have KB articles to change the row color based in the property and record. 
KB Links: 
Also, could you please refer the below UG link to change the row style based on the converter and style selectors, 
Regards, 
Jai Ganesh S 


Loader.
Up arrow icon