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

Changing Tab Order in RadGridView when using HtmlViewDefinition

1 Answer 177 Views
GridView
This is a migrated thread and some comments may be shown as answers.
willi
Top achievements
Rank 1
willi asked on 25 Jun 2010, 09:29 AM
Hi!

I'm trying to change the Tab Order in the Telerik RadGridView when using HtmlViewDefinition. Is this possible?
Please see the attached File, Blue is the current order and red is the order i want.

Please help

regards

Willi

Initializing HtmlViewDefinition:
 Dim htmlView As New HtmlViewDefinition 
 
        With htmlView.RowTemplate 
            .Rows.Add(New RowDefinition) 
            .Rows(0).Cells.Add(New CellDefinition("cmbIcpmppCode")) 
            .Rows(0).Cells.Add(New CellDefinition("dtDatum")) 
            .Rows(0).Cells.Add(New CellDefinition("cmbLocal")) 
            .Rows(0).Cells.Add(New CellDefinition("txtZusatz")) 
            .Rows(0).Cells.Add(New CellDefinition("chkHauptleistung")) 
            .Rows(0).Cells.Add(New CellDefinition("grdCmdDelete")) 
 
            .Rows(0).Cells(1).RowSpan = 2 
            .Rows(0).Cells(2).RowSpan = 2 
            .Rows(0).Cells(3).RowSpan = 2 
            .Rows(0).Cells(4).RowSpan = 2 
            .Rows(0).Cells(5).RowSpan = 2 
 
            .Rows.Add(New RowDefinition) 
            .Rows(1).Cells.Add(New CellDefinition("cmbArzt")) 
 
        End With 
        grdOPdaten2.ViewDefinition = htmlView 

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 30 Jun 2010, 01:59 PM
Hello willi,

Thank you for contacting us.

The tab order is defined by the RenderColumns collection of the HtmlViewDefinition class, and you can't change it. However, you can replace the default grid behavior and override the ProcessTabKey method. This way you will gain full control over keyboard events and you can implement any desired tab behavior. Here is a sample:

radGridView1.GridBehavior = new GridBehavior();
      
public class GridBehavior : BaseGridBehavior
{
    protected override bool ProcessTabKey(KeyEventArgs keys)
    {
        GridViewDataColumn dataColumn = GridControl.CurrentColumn as GridViewDataColumn;
        if (dataColumn.UniqueName == "ICPM++ Code")
        {
            GridControl.Columns["Datum"].IsCurrent = true;
            return true;
        }
        return base.ProcessTabKey(keys);
    }
}

 

Sincerely yours,
Jack
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
willi
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or