Home Forums WPF controls Xceed DataGrid for WPF Alternating color for DataGridControl rows

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24591 |

    Ok, this may seem like a very simple answer, but I am having trouble setting an alternating row color for my DataGridControl that I have been testing out for WPF. I haven’t been able to see any documenation on exactly how to do that. Any examples? Sorry if this one is to easy, but I am really new to WPF!

    Imported from legacy forums. Posted by Jonathan (had 599 views)

    Xceed Support
    Member
    Post count: 5658

    I recommend checking the Example 2 from this page of the documentation:

    <a href=”http://doc.xceedsoft.com/products/XceedWpfDataGrid/Styles.html”>http://doc.xceedsoft.com/products/XceedWpfDataGrid/Styles.html</a&gt;

    Imported from legacy forums. Posted by Marcus [Xceed] (had 448 views)

    User (Old forums)
    Member
    Post count: 23064

    I tried using xaml snippet from that example mentioned but got errors on the following line:

    <xcdg:IndexToOddConverter x:Key=”rowIndexConverter”/>

    error MC3074: The tag ‘IndexToOddConverter’ does not exist in XML namespace ‘http://schemas.xceed.com/wpf/xaml/datagrid&#8217;.

    I have the xceed namespace defined at top of XAML file as follows:

    xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid&#8221;

    Imported from legacy forums. Posted by Kevin (had 452 views)

    Xceed Support
    Member
    Post count: 5658

    What version of the grid are you using? IndexToOddConverter was added after the intial release.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 292 views)

    User (Old forums)
    Member
    Post count: 23064

    Try to create style for DataRow with different color:
    <Style TargetType=”{x:Type xcdg:Row}”>
    <Setter Property=”Background” Value=”YourColor”/>
    <Setter Property=”MinWidth” Value=”{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollContentPresenter}}, Path=ActualWidth}”/>
    </Style>

    Imported from legacy forums. Posted by Lena (had 4436 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.