This is a migrated thread and some comments may be shown as answers.

Cell Style template not applying for the GridViewDataColumn

2 Answers 290 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Dharmavaram
Top achievements
Rank 1
Dharmavaram asked on 27 Jul 2017, 09:24 AM

Hi,

I am trying to apply background color to particular GridViewDataColumn in RadTreeListView.If I directly set the background color it is working fine, but when I use CellStyle Parameter and set the style it is not working and data also not populating once CellStyle Parameter is given.

 

 Xaml Code realted  to GridViewDatacolumn as below

   <telerik:RadTreeListView.Columns>

<telerik:GridViewDataColumn Width="*" ShowFilterButton="False" Header="Action Descriptor"
                                                    IsReadOnly="True"  CellStyle="{StaticResource cellStyleTemplate}"
                                                    DataMemberBinding="{Binding DataContext,RelativeSource={RelativeSource Self}  ,Converter={StaticResource NodeToDisplayNameConverter}}"  >

   </telerik:RadTreeListView.Columns>

 

Template used 

   <Style x:Key="cellStyleTemplate" TargetType="telerik:GridViewCell">
            <Setter Property="Background" Value="Red"/>
        </Style>

 

Regards,

Nagasree

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 28 Jul 2017, 12:33 PM
Hello Nagasree,

Without your implementation I cannot be sure but my guess is that you are using NoXaml dlls. If so, you will need base the GridViewCell Style to the default style of the control.
<Style x:Key="cellStyleTemplate" TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
    <Setter Property="Background" Value="Red"/>
</Style>

I hope this helps.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Dharmavaram
Top achievements
Rank 1
answered on 02 Aug 2017, 04:43 AM

Hi,

 

Thanks it is working fine.

Tags
TreeListView
Asked by
Dharmavaram
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Dharmavaram
Top achievements
Rank 1
Share this question
or