Remove gridlines on rowstyleselection

5 posts, 0 answers
  1. Wade
    Wade avatar
    22 posts
    Member since:
    Dec 2012

    Posted 09 Jan 2013 Link to this post

    Greetings.

    I am using the Telerik RadGridView control to display data. In one screen I am using it without the rowstyleselector, in another I am using it with the rowstyleselector.

    In the instance without the rowstyleselector, I use GridLinesVisibility="None"> and it works fine, the gridlines are gone.

    But in the instance with the rowstyleselector, I use the following code, but the gridlines are still visible.

    <Queue:TelephonyCallQueueRowStyleSelector.ConnectedToOtherStyle>
                <Style TargetType="TelerikGridView:GridViewRow">
                    <Setter Property="Background">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="Black" Offset="0.96"/>
                                <GradientStop Color="#FFBDFDBD" Offset="0.95"/>
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                    
                    <Setter Property="Grid.ShowGridLines" Value="False" />
                </Style>
            </Queue:TelephonyCallQueueRowStyleSelector.ConnectedToOtherStyle>

    Why won't the gridlines go away?

    Thanks,

    Wade
  2. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 11 Jan 2013 Link to this post

    Hi Wade,

    As I can see from the code snippet you provided, you are using the MS Grid's property - ShowGridLines.
    As you know RadGridView has the GridLinesVisibility property, but I am afraid that you can not use it in your row's style since its targets the GridViewRow than RadGridView. May I ask you to share what is the exact result you would like to get?

    Regards,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Wade
    Wade avatar
    22 posts
    Member since:
    Dec 2012

    Posted 11 Jan 2013 Link to this post

    I have two screens that use the radgridview, but one uses rowstyleselection and one does not. In the one that doesn't I can remove the gridlines without issue. The issue I'm having is with the radgridview that uses the rowstyleselection. I have attached a screenshot so you can see the difference. The desired effect is that I have no grid lines.

    Thanks for your reply.

    Wade
  5. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 16 Jan 2013 Link to this post

    Hello Wade,

    The possible solution would be to set GridView's GridLinesVisibility to None, but as I mentioned in my previous reply, you are not able to apply it through RowStyleSelector. You can define an explicit (using x:key) style instead. Then you can apply it to a RadGridView, like so :

    <Window.Resources>
            <Style x:Key="MyGridStyle" TargetType="telerik:RadGridView">
                <Setter Property="GridLinesVisibility" Value="None"/>
            </Style>
    </Window.Resources>
    <telerik:RadGridView
                                 Name="clubsGrid"
                                 ItemsSource="{Binding Clubs}"
                                 Style="{StaticResource MyGridStyle}"/>

    All the best,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Wade
    Wade avatar
    22 posts
    Member since:
    Dec 2012

    Posted 17 Jan 2013 Link to this post

    Thanks, for the help. We have decided to go a different rout that doesn't use the rowstyleselector.
Back to Top
UI for WPF is Visual Studio 2017 Ready