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

[Solved] Alternating row color for GridViewComboBox items

1 Answer 110 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alex
Top achievements
Rank 1
Alex asked on 22 Aug 2011, 02:49 PM
I have a GridViewComboBox column that I have a custom layout for as shown below.   

<telerik:GridViewComboBoxColumn.ItemTemplate>
   <DataTemplate>
      <StackPanel>
         <TextBlock Text="{Binding ProjectCode}" />
         <TextBlock Text="{Binding ProjectDescription}" FontSize="10"/>
      </StackPanel>
   </DataTemplate>
</telerik:GridViewComboBoxColumn.ItemTemplate>


I would like to use an alternating background color for each item.  Is there a way to specify alternating row color for the ComboBox items?  Either in XAML or codebehind?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 22 Aug 2011, 03:18 PM
Hello Alex Durrant,

Such feature is not supported internally. We do not have row background alternation API.

As a workaround I may suggest to provide some property (boolean or integer , or even brush)  in the object used as a source collection for the combo.

Then in the item template you can bind the background to that property ( either directly, or via IValueConverter).

All the best,
Pavel Pavlov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Alex
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or