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

Disable cell border and tab to next row instead of cell

20 Answers 763 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Missing User
Missing User asked on 17 Dec 2010, 11:58 AM
I just upgraded from Q1 SP2 to Q2 SP1 and I noticed that when I select a cell I get an annoying border around it (Just the selected cell). After looking through some other complaints about it here I found a xaml which removes the border but when I press TAB or ALT it's still there. I tried to set all colors to alpha but it's still there. How to remove all additional cell selection/focus borders completely, I don't want it to appear ever. Please note that I don't want to remove the outer borders of the cells but the additional inner border for a cell select.

On another note, how can I set the GridView to go to the next row on TAB instead of the next cell, I'm not interested in any cell, just the rows (Hence I also don't want the selected cell border).

Thanks!

20 Answers, 1 is accepted

Sort by
0
Missing User
answered on 20 Dec 2010, 12:30 AM
No one from support or someone else who knows this?
0
Vanya Pavlova
Telerik team
answered on 20 Dec 2010, 05:38 PM
Hello Marcel,

 

To achieve the desired result you need to edit the template of GridViewCell and remove the Border element named Background_Current as well as its corresponding trigger. Please find the attached project that demonstrates this technique.

Kind regards,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Missing User
answered on 20 Dec 2010, 05:54 PM
Hello,

I already did that but when I press ALT or TAB I still get the border around it. I don't want this.

Best Regards
0
Vanya Pavlova
Telerik team
answered on 21 Dec 2010, 04:00 PM
Hello Marcel,

 
Please accept my apology for the initial omission. The border is still there, because there is one WPF specific property FocusVisualStyle which causes this border to appear, ignoring the fact that the border element named Background_Current is removed.

Please change the style from my previous example in the following way:

<Style ......>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="FocusVisualStyle"                   Value="{x:Null}">
                  </Setter>
</Style>


 

All the best,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Missing User
answered on 21 Dec 2010, 07:13 PM
Thanks, didn't know about that property, much appreciated!

About my other question, is there any way to set a property of some kind to enable TAB button to go to next row instead of cell? Or do I have to code this myself?
0
Vanya Pavlova
Telerik team
answered on 22 Dec 2010, 03:07 PM
Hello Marcel,

 

You need to predefine the default keyboard navigation in RadGridView as it is demonstrated in the following blog post.

All the best,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Missing User
answered on 22 Dec 2010, 05:21 PM
Thanks, works fine!

Another question (not worth reopening another thread for), how can I change codewise the background color or a row (I want a different color based on a value), I know it can be done XAML wise but I'd rather set it from code so I can access all variables I need for this purpose. I tried with ChildrenOfType but it didn't get anything, also ItemContainerGenerator.ContainerFromItem but that didn't get a RadGridRow from the items in the ItemsSource.
0
Vanya Pavlova
Telerik team
answered on 23 Dec 2010, 03:45 PM
Hi Marcel,


You need to use Conditional styles and Templates, as demonstrated in the following blog post.
You can also check our online "RowStyleSelectors" demo.

All the best,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Julian
Top achievements
Rank 1
answered on 11 Oct 2011, 12:36 PM
Hi,

I'm trying to disable Focusable on my columns:
<Style TargetType="{x:Type namespace:GridViewCell}">
     <Setter Property="Focusable" Value="False"/>
     <Setter Property="IsTabStop" Value="False"/>
     <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
</Style>

it doesn't works for me.

Btw. you example doesn't works too.

Need support,
thanks.
Julian


0
Vanya Pavlova
Telerik team
answered on 11 Oct 2011, 12:51 PM
Hi Julian,

 


Are you trying to remove the Border which appears when a cell goes into its current state or maybe I am missing something? If that is the case you cannot achieve the desired result with a simple style, you should predefine the template of GridViewCell as demonstrated in the following online help article.
I am attaching you sample project which demonstrates how this can be achieved.




Kind regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Tingting
Top achievements
Rank 1
answered on 09 May 2012, 03:26 PM
Hello , 

   I have a problem with my customer MessageBox. When it is displayed, it is shown on top of my main application window,  as I would like.  But i  can always choose the controls in my main window by TAB Button which i dont want to.  Is there a way that I can force the focus to remain only on the messagebox when it is displayed ?  When it is closed, the focus will return on my main  window . 





 
 





0
Milbrey
Top achievements
Rank 1
answered on 16 Jun 2014, 09:52 AM
is there any way to set a property of some kind to enable TAB button to go to next row instead of cell?

Can you share the link again to your answer to this question? Seems it can no longer be found.
0
Nick
Telerik team
answered on 16 Jun 2014, 11:06 AM
Hello Milbery,

Here is the link to the CustomKeyboardProvider article

Hope it helps. 

Regards,
Nik
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Doug
Top achievements
Rank 2
answered on 06 Jan 2015, 09:38 PM
This process is going to be quite time consuming if a user works with gridviews a lot.  I would like to please ask, that this be a settable flag like selecting the entire row.  Please consider this a feature request.
0
Nick
Telerik team
answered on 07 Jan 2015, 12:42 PM
Hi Marcel,

Indeed this may be a bit time consuming but adding such a property suggests adding properties for every keyboard action on a later stage, which will lead to a huge amount of boolean properties controlling specific interactions, which may interfere with each other. This is extremely hard to maintain and test and that is why we haven't done it until now, and the proper way to do it is with a custom keyboard provider. 

Hope this makes sense. 

Regards,
Nick
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Doug
Top achievements
Rank 2
answered on 07 Jan 2015, 12:44 PM
I am suggesting nothing to do with the keyboard.  What I am suggesting is if I'm not using any data editing, and selecting an entire row, i probably don't want the annoying cell selection border, it serves no purpose at this point.
0
Doug
Top achievements
Rank 2
answered on 07 Jan 2015, 09:19 PM
The other BIG issue I have noticed with this, it is doesn't seem to be able to be used in conjunction with RadBusyIndicator

An unhandled exception just occurred: Cannot animate the 'Visibility' property on a 'System.Windows.Controls.Border' using a 'System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames'. For details see the inner exception.

An unhandled exception just occurred: Cannot animate the 'Opacity' property on a 'System.Windows.Controls.ContentPresenter' using a 'System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames'. For details see the inner exception.
0
Nick
Telerik team
answered on 12 Jan 2015, 07:20 AM
Hi Doug,

It would be best to open a separate issue (support thread) for the Busy indicator problem, in order to get the best and most detailed assistance. 

As for the original issue, I am sorry for the misunderstanding I will discuss the possibility of adding this feature with our development team. 



Regards,
Nick
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Martin
Top achievements
Rank 1
Veteran
answered on 14 Aug 2020, 09:21 AM
I totally agree with this. It is very annoying to have to create a whole new template, just to remove the border around a cell.
0
Dinko | Tech Support Engineer
Telerik team
answered on 19 Aug 2020, 08:27 AM

Hi Martin,

In the R3 2019 version for our controls, we have introduced a way to change the current cell border without modifying the whole template. In a few words, we have added CurrentBorderBrush property to the GridViewCell element. You can find more information regarding this in the following section: Setting the BorderBrush of the CurrentCell. In your case, to remove it, you can set this property to Transparent. You can do that by creating an implicit style targeting GridViewCell.

<Style TargetType="telerik:GridViewCell"> 
    <Setter Property="CurrentBorderBrush" Value="Transparent" /> 
</Style> 

Regards,
Dinko
Progress Telerik

Tags
GridView
Asked by
Missing User
Answers by
Missing User
Vanya Pavlova
Telerik team
Julian
Top achievements
Rank 1
Tingting
Top achievements
Rank 1
Milbrey
Top achievements
Rank 1
Nick
Telerik team
Doug
Top achievements
Rank 2
Martin
Top achievements
Rank 1
Veteran
Dinko | Tech Support Engineer
Telerik team
Share this question
or