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

Issue regarding grid filter.

3 Answers 25 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shulla Krous
Top achievements
Rank 1
Shulla Krous asked on 02 Oct 2011, 09:49 AM

Hello Telerik Team,

I Have an issue regarding the filter of the grid on readOnly columns.

When the user goes between the filter cells with the Tab key or the Arrow keys the curser skips the readOnly columns.

How can this behavior be fixed?

                                                               

Regards,

Namma.

3 Answers, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 04 Oct 2011, 12:07 PM
Hi Naama,

Thank you for writing and for reporting this issue.

You can solve this issue by overriding the RadGridView behavior. You can create your behavior by inheriting from BaseGridBehavior and overriding the needed methods. I have attached a sample project where I have implemented this scenario for you. 

I have added this bug in our Public Issue Tracking System - PITS. You can track the progress of this issue here. I have also updated your Telerik point for reporting this issue.

I hope this will help. If you have further questions, I would be glad to help.

Best wishes,
Ivan Petrov
the Telerik team

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

0
Shulla Krous
Top achievements
Rank 1
answered on 05 Oct 2011, 12:18 PM

b.s.
Thank you for your help.

I have used the cold you sent, it was very helpful.  

But it does not cover the case when the grid contains Visible=False columns.

The cursor gets stack in a column if the next or previous column is Visibile=False.

I have fixed this bug, in the following function.

Note: my grid is right to left.

An upgrade of our points would be appreciated.

 

private bool ProcessNavigationalKeys(KeyEventArgs keys)

        {

            if (this.GridControl.CurrentRow is GridViewFilteringRowInfo)

            {

                int columnIndex = this.GridControl.CurrentColumn.Index;

                if ((keys.KeyCode == Keys.Tab && keys.Shift) || keys.KeyCode == Keys.Right)

                {

                    while (columnIndex > 0 && !this.GridControl.Columns[columnIndex - 1].IsVisible)

                    {

                        columnIndex--;

                    }

                    if (columnIndex > 0)

                    {

                        this.GridControl.Columns[columnIndex - 1].IsCurrent = true;

                        return true;

                    }

                }

                else if ((keys.KeyCode == Keys.Tab && !keys.Shift) || keys.KeyCode == Keys.Left)

                {

                    while (columnIndex < this.GridControl.Columns.Count - 1 && !this.GridControl.Columns[columnIndex + 1].IsVisible)

                    {

                        columnIndex++;

                    }

                    if (  columnIndex < this.GridControl.Columns.Count - 1)

                    {

                        this.GridControl.Columns[columnIndex + 1].IsCurrent = true;

                        return true;

                    }

                }

            }

            return false;

        }

0
Ivan Petrov
Telerik team
answered on 06 Oct 2011, 04:00 PM
Hi Naama,

Thank you for your reply and for the code snippet.

Indeed, the code I sent does not take into consideration the columns that are not visible, but I am glad you have found your way around this. As to the Telerik points I have updated your points before my previous post was sent to you. Please check your account for the updated values.

Write back should you need further assistance.

Kind regards,
Ivan Petrov
the Telerik team

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

Tags
GridView
Asked by
Shulla Krous
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Shulla Krous
Top achievements
Rank 1
Share this question
or