Necessary to make the text of the bill that comes to be selected, what does not happen with my code.
If e.KeyCode = Keys.Up Then appGrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.AboveCell)ElseIf e.KeyCode = Keys.Down Then appGrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.BelowCell)End If
I am still having a very hard time understand what you want.
It sounds like you should be using the TabNavigation property and also the TabStop property on the column to skip certain columns when tabbing.
If you want to control exactly where the focus moves to when you press any of these keys, you could handle the BeforePerformAction event and cancel the event and then set the ActiveCell in the grid to any cell you want.
It is the order of my form.
In the grid col1 is blocked and col2 is free for editing. TabNavigation the grid is as nextcell.in the form keydown event I put this code:If e.KeyCode = Keys.Enter Then SendKeys.Send("{TAB}") e.Handled = True Problem 1: the focus goes by textbox1, textbox 2, cells of col2. When I get to the last cell to go to the textbox 3, But I can not.End If
in the grid keydown event I put this code:If e.KeyCode = Keys.Up Then appGrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.AboveCell) PROBLEM 2: enter edit mode but does not select the content.ElseIf e.KeyCode = Keys.Down Then appGrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.BelowCell) PROBLEM 2: enter edit mode but does not select the content.End If
in the grid AfterCellActivate event I put this code:If appGrid.ActiveCell.Column.Index = 2 Then appGrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode)Else appGrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextCell)End If
miguelsneto said: that happens when I press the up and down it goes into edit mode selects the most content of the ballot.And I need to get the contents of the note is selected. Excuse my English, I am Brazilian and I'm using google translator.
that happens when I press the up and down it goes into edit mode selects the most content of the ballot.And I need to get the contents of the note is selected.
Excuse my English, I am Brazilian and I'm using google translator.
I'm afraid that the translator is not doing a good job here. This sentence does not make any sense to me. So I still do not understand the question.
miguelsneto said:When I arrive at the last cell and he will not grasp ENTER to the next control. He stops at the last Cell.
this.ultraGrid1.DisplayLayout.TabNavigation = TabNavigation.NextControlOnLastCell;
I tried to understand more technical was very English. Could you explain for example?I would be most practical to understand.
One thing to note is that there may very well be an entry in the KeyActionMappings collection for the up and down arrow keys, which means that in addition to the action you are performing by calling PerformAction, the grid will execute the action mapped to that key immediately thereafter, which is almost certainly going to cause unexpected behavior. You should set e.Handled to true when you do something with the keystroke, so the grid doesn't process it.
Regarding the enter key: when an entry in the KeyActionMappings collection is found for a given key, we return true from the control's IsInputKey method for it, which causes the runtime to interpret the key as handled, and thus does not perform the default navigational action for it. If you remove all members from the KeyActionMappings collection for a given key, IsInputKey will then return false for that key, allowing the default processing to take place.