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

Column Header tab order

3 Answers 149 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Cory
Top achievements
Rank 1
Cory asked on 09 Dec 2015, 06:13 PM

 

So I think I found an issue with tabbing between column headers, after the columns have been rearranged.  

When changing column position (rearranging columns) on a rad grid, tabbing between headers does not follow the display index.  In instead follows the original position of the column.

 You can see this behavior on the "GridView Filtering Configuration" demo from the WPF controls examples Telerick tool.

Once you choose the Filtering Configuration demo\example, change the filtering mode to "FitlerRow".  You can tab through the headers and the keyboard focus will go to each column properly (Customer ID, Company Name, Country, etc..)

If you move the Country column in between the Customer ID and Company Name.  When starting at the Customer ID and tabbing, the tab order remains unchanged (Customer ID, Company Name, Country, etc..).  When in fact it should go Customer ID, Country, Company Name, etc.

When selecting a row, the tab order works as expected.

I did some research, but was unable to find a way to work around this.  Am I missing something.

Additionally, I was able to smooth out the tabbing (to reduce the number of tabs in the header), with the code below.

 

        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            foreach (var headerCell in AssociatedObject.ChildrenOfType<GridViewHeaderCell>())
            {
                //var popUp = headerCell.ChildrenOfType<Popup>().FirstOrDefault();

                var filteringControl = headerCell.ChildrenOfType<FieldFilterControl>().FirstOrDefault();

                if (filteringControl != null)
                {
                    (filteringControl.ChildrenOfType<RadDropDownButton>().FirstOrDefault()).IsTabStop = false;
                }

                var contentControls = headerCell.ChildrenOfType<ContentControl>().Where( con => con.IsTabStop == true).ToList(); ;

                foreach (var content in contentControls)
                {
                    content.IsTabStop = false;
                }          
            }
        } 

 

        private void Grid_FieldFilterEditorCreated(object sender, EditorCreatedEventArgs e)
        {
            var stringFilterEditor = e.Editor as StringFilterEditor;
            if (stringFilterEditor != null)
            {
                stringFilterEditor.MatchCaseVisibility = Visibility.Collapsed;
            }
        }

 

Thanks,

Cory

 

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Petya
Telerik team
answered on 14 Dec 2015, 03:45 PM
Hello Cory,

Thanks for letting us know about this, indeed it appears to be an issue in RadGridView's functionality. I logged it in our backlog and updated your Telerik points in appreciation of the report. You can follow the team's progress on this through this item in our public portal. I'm afraid that I wasn't able to find a workaround either, so for the time being, there's nothing I can suggest in order to avoid that behavior.

As to the logic you mentioned, please bear in mind that RadGridView supports UI Virtualization both for its columns and rows, and reuses many of its visual elements like GridViewCell, GridViewRow, etc. For this reason, we advise against using the elements directly in code and applying modifications in them so I'll suggest modifying the templates of the respective controls instead. Take a look at the Styling Column Headers and Styling FilterRow articles in our documentation for a reference on how you can apply the modifications.

I hope this helps.

Regards,
Petya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Cory
Top achievements
Rank 1
answered on 14 Dec 2015, 04:20 PM
  • "Take a look at the Styling Column Headers and Styling FilterRow articles in our documentation for a reference on how you can apply the modifications."

 Ok I will, thanks for the tip.

 

Cory

 

0
Cory
Top achievements
Rank 1
answered on 15 Dec 2015, 03:41 PM

Just to close the loop.  To turn off the tab stop on the RadDropDownButton control, I added a setter to the "FieldFilterDropDownButtonStyle" style in the Telerik.Windows.Controls.GridView.xaml file.

 To turn off the tab stop on the content control - I modified the first content control in the "FieldFilterControlTemplate" in the same file.

 I went ahead and left the code that turned off MatchCaseVisibility - since that uses Telerik's public API.

Thanks for the help,

Cory

 

 

Tags
GridView
Asked by
Cory
Top achievements
Rank 1
Answers by
Petya
Telerik team
Cory
Top achievements
Rank 1
Share this question
or