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

GridViewCell Background/Border changes

11 Answers 533 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 15 Jul 2011, 09:56 PM
Greetings,

Today, we upgraded from the Q3/2010 controls to the Q2/2011 controls on our application. For the most part, everything upgraded without any problems. However, there's one discrepancy that has me stumped. I'm not sure about the best way to resolve this, so i wanted to get your help.

To illustrate the problem, I have a very simple RadGridView defined. The second column has a Background of "GhostWhite":

<Telerik:RadGridView x:Name="GridView" AutoGenerateColumns="False" Width="500" Height="500">
     <Telerik:RadGridView.Columns>
          <Telerik:GridViewDataColumn UniqueName="DateTime" Header="Date/Time"
               DataMemberBinding="{Binding DateTime}" IsReadOnly="True"
               DataType="{x:Type System:DateTime}" IsFilterable="True" />
          <Telerik:GridViewDataColumn UniqueName="Value" Header="Value"
               Background="GhostWhite" DataMemberBinding="{Binding Value}"
               DataType="{x:Type System:Decimal}" IsFilterable="True" />
            </Telerik:RadGridView.Columns>
        </Telerik:RadGridView>

When I populate my grid with items, the cells in the second column are missing the left side of their border. If I remove the Background attribute on the second column the cell's left side is back and looks just fine.

I was able to use Expression Blend/WPF Inspector to locate the "PART_CellBorder" border. It looks like the BorderThickness here may not account for the left side.

Is this by design? Is there are work around?

Thanks!

11 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 20 Jul 2011, 04:51 PM
Hello John,

Thank you for the report.
Indeed, there is a problem when setting background to a column. I logged it as a PITS issue with ID7049 so you can track its status.

Excuse us for the inconvenience. I have updated your Telerik points.
 
All the best,
Yordanka
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
John
Top achievements
Rank 1
answered on 20 Jul 2011, 04:56 PM
Thanks for the feedback. Do you have any ideas on how I can work around this problem (i.e. a short term solution) until it gets resolved?

I've tried creating a custom GridViewCell style, but didn't have much luck getting the border to show up correctly.

Can you help?

Thanks again.
0
Yordanka
Telerik team
answered on 20 Jul 2011, 05:07 PM
Hello John,

Unfortunately, we couldn't find a stable workaround for the issue. We will raise its priority and will do our best to address it in one of the next internal builds.
 
Kind regards,
Yordanka
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Mateusz
Top achievements
Rank 1
answered on 19 Jan 2018, 11:09 AM

Hello,

Have you finally fixed it? I'm facing similar problem.

0
Stefan
Telerik team
answered on 24 Jan 2018, 08:55 AM
Hi Mateusz,

The issue is already fixed with the Q3 2013 SP1 official release. You can find more information in the Release History for this version. Can you please check it out?

All the best,
Stefan
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
Mateusz
Top achievements
Rank 1
answered on 24 Jan 2018, 11:47 AM

Hi Stefan,

I suppose, I'm doing something wrong then (screenshot in attached files). I'm using cell style setter, which programmicaly is changing color to red (for some reasons) and for green I'm using Background property for column. Why am I missing horizontal borders?

 

Regards

 

0
Stefan
Telerik team
answered on 29 Jan 2018, 11:04 AM
Hello Mateusz,

From the provided information I cannot confirm the exact cause for the behavior you are experiencing. However, the recommended approach for applying such visual modifications is through the usage of CellStyleSelector. Can you please give it a try? Is the behavior reproducible with it as well?

Regards,
Stefan
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
Mateusz
Top achievements
Rank 1
answered on 29 Jan 2018, 02:43 PM

Hi Stefan, 

 

I am using CellStyleSelector and getting results I've posted on screenshot (red ones), as for green is simple Background coloring. How do I get my borders back?

0
Stefan
Telerik team
answered on 01 Feb 2018, 09:21 AM
Hi Mateusz,

The behavior you are experiencing seems to be related to the specific project setup, rather than to the implementation of the CellStyleSelector mechanism. I have attached a sample application which demonstrates this. Can you please take a look at it?

I hope it helps.

Regards,
Stefan
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
Jennifer
Top achievements
Rank 1
Iron
answered on 13 Feb 2018, 05:20 PM

I am having the same issue.  It seems to be a theme-related issue, as we are using several themes in our project and most of them still have the horizontal lines when adding a style to the cells.  In the Office2013 theme, the horizontal grid lines are hidden in both the RadGridView and the RadTreeListView; in the Expression_Dark theme, the horizontal grid lines are hidden in the RadGridView.  Even explicitly adding a BorderThickness and a BorderBrush to the style in addition to a background does not help.

I downloaded the sample application attached in the previous post and added the Office2013 theme to it.  It exhibited the same issue.

 

0
Stefan
Telerik team
answered on 16 Feb 2018, 12:39 PM
Hi Jennifer,

Thank you for the clarification.

Thanks to it I managed to replicate the problem. It indeed seems to be an issue related to an already known one: Bottom border missing in invalid grid cell. I have now increased the priority of the item in our backlog. The workaround is to apply a 1px bottom margin for the "PART_CellBorder" Border in the template of GridViewCell.

Please, excuse us for the inconvenience caused.

Regards,
Stefan
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.
Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Yordanka
Telerik team
John
Top achievements
Rank 1
Mateusz
Top achievements
Rank 1
Stefan
Telerik team
Jennifer
Top achievements
Rank 1
Iron
Share this question
or