[Telerik] GridView row foregroud color

2020. 6. 2. 17:07Development/WPF

Xaml:

<jofC:JofContentPage.Resources>

  <jofUtil:strComplateToColorConveter x:Key="comValueConverter"></jofUtil:strComplateToColorConveter>

</jofC:JofContentPage.Resources>

 

<tr:GridView JofGridView  x:Name="grdMaster>

<jofC:JofGridView.RowStyle>

  <Style TargetType="telerik:GridViewRow" >
    <Setter Property="Foreground" Value="{Binding salepinspection,Converter={StaticResource comValueConverter}}"></Setter>
  </Style>

</jofC:JofGridView.RowStyle>

 

Xaml.cs :

grdMaster.ItemsSource = dtMaster.DefaultView;

grdMaster.AlternationCount= dtMaster.RowCount+1;

 

Class : strComplateToColorConveter

using Windows.Data, Windows.Media;

public class strComplateToColorConveter : IValueConverter

{

  string strValue = value.ToString();

 if (strValue == "1")

  {

     return new SolidColorBrush(Colors.Blue);

  }

return new SolidColorBrush(Colors.Black);

}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)

{throw new NotImplementedException();}

 

 

 

 

 

'Development > WPF' 카테고리의 다른 글

[Telerik] 그리드 셀s 복사/붙혀넣기  (0) 2020.06.26
[RPA] WPF CONTROL 접근  (0) 2020.06.09
[MVVM] View Loading  (0) 2020.06.09
[Error] UI Thread 충돌 방지  (0) 2020.05.22
[FTP] 프린터출력 pdf -> ftp로 전송  (0) 2020.05.22