简体   繁体   中英

Remove formatting for specific column RadGrid MVVM

I am using a WPF Application, In that i am using a telerik gird and also i am using MVVM model to bind data in the grid. I have set the rows to gray color and readonly based on some values. Its working fine.

Now i have to remove the formatting for 3 specific columns (ie) i have to make the background to white and readonly to false.

The row made gray using the below code,

//Code:

<telerik:RadGridView.RowStyle>
<Style TargetType="{x:Type telerik:GridViewRow}">
 <Style.Triggers>
 <DataTrigger Binding="{Binding IsActive}" Value="True">
 <Setter Property="Background" Value="Gray" />
 </DataTrigger>
 </Style.Triggers>
 </Style>
 </telerik:RadGridView.RowStyle>

Row made ReadOnly using the below code,

<telerik:RadGridView x:Name="radGridView" IsReadOnlyBinding="{Binding IsActive}" />

How can i achieve this?

I have achieved like this,

<telerik:GridViewDataColumn Header="Name" IsReadOnlyBinding="{Binding IsActive}">
</telerik:GridViewDataColumn>

Binding the value to each of the column made this work. For those columns which are editable just got rid of IsActive .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM