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

from current row to next row by Enter key in group and filter

1 Answer 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
AJing
Top achievements
Rank 1
AJing asked on 30 Nov 2011, 01:50 AM
Hi :    
     The radgridview enable group and filter. The user want to skip the next row from current row and the next row into edit mode by Enter.  
       1. Our code as follows to achieve the enter key, :
        private voi dg_KeyUp(.....)
        {                  ......
              if((dgCut.CurrentRow.Index+1)<dgCut.Rows.Count)
              {
                     var row =dgCut.Rows[dgCut.CurrentRow.Index+1];
                     dgCut.CurrentRow=row;
                     if(dgCut.CurrentCell!=null)
                     { dgCut.CurrentCell.BeignEdit();}
               }
         }
      but if there is a filter by column 'Name', the enter key event behavior is strange.The current row can not skip to next row.

      To solve the problem with filter,we update the code as follows:
        private voi dg_KeyUp(.....)
        {                  ......
              if((dgCut.MasterView.CurrentRow.Index+1)<dgCut.MasterView.Rows.Count)
              {
                     var row =dgCut.MasterView.Rows[dgCut.MasterView.CurrentRow.Index+1];
                     dgCut.MasterView.CurrentRow=row;
                     if(dgCut.MasterView.ViewTemplate.CurrentColumn!=null)
                     { dgCut.CurrentCell.BeignEdit();}
               }
         }

        
      the result as we do is :it is Ok by Enter key if there is only exsit filter.It is not Ok if there is group and filter.
     How to achieve the enter key behavior  if there is  a group or multiple group and a filter or multiple filter?

Greetings
Look forward to you
Ajing     
   

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 02 Dec 2011, 03:05 PM
Hello Ajing,

The Rows collection of RadGridView control contains all data rows without filtering, sorting, grouping applied. If you want to manipulate current view of row collections you must use ChidlRows property. The best solution for your navigation scenario is to use GridTraverser. Please read this forum post regarding the solution.

I hope this helps. Let me know if you need further assistance.

All the best,
Julian Benkov
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Tags
GridView
Asked by
AJing
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or