NumericUpDown in datagridView

0
0

Hi,

 

I have a datagridview, with NumericUpDown column, I want to use arrow up/down to move from next row or previous row, but it will update the value instead. How do I do it correctly?

 

Thanks.

 

  • You must to post comments
0
0

Hi Glenn,

the fix is available in Wisej development build 2.2.33.

Best regards
Frank

  • You must to post comments
0
0

Hi, how can I set SelectOnEnter property to true, this property is not accessible from code? But I can see it through properties when in design mode. I want a behaviour when cell enters in edit mode, it will automatically select all text so that user can just type in a new value, right now, when it enters in edit mode, the cursor is in the right most part, and I cannot use arrow left to move to the left, I have to use the mouse and it’s time consuming for the user to navigate.

  • Levie (ITG)
    Are you talking about in the Column Editor? It should be visible in the normal Property window for the NumericUpDown control.
  • Glenn Gonzales
    Yes in the Column Editor
  • Levie (ITG)
    Thanks for the clarification! I’ll log an enhancement to add it to the property list! -Levie
  • Levie (ITG)
    We’ve finished the enhancement and it will be available in the next build!
  • Glenn Gonzales
    Hi, I have downloaded the development builds, I cannot find the SelectOnEnter property in the property editor window. Thanks.
0
0

Hi Glenn,

We also logged an issue with the InterceptArrowKey property. When it’s disabled it also disabled editing the NumericUpDown control with the keyboard. The issue is fixed and will be available in the next build.

 

Sorry for the inconvenience.

Best,

Levie

  • You must to post comments
0
0

Hi Glenn,

The InterceptArrowKeys property is what you’re looking for.

You can disable it in the EditingControlShowing event (cast e.Control to a Wisej.Web.NumericUpDown control):

private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
    var control = (NumericUpDown)e.Control;

    control.InterceptArrowKeys = false;
}

 

You can also create a custom NumericUpDown control and set it to be the Column’s Editor control:

this.dataGridView1.Columns[0].Editor = this.myNumericUpDownControl;

When you set the editor control for a column, the event handlers and properties are applied to each cell editor in that column.

 

To handle the Arrow key events, you’ll want to add a handler for the KeyDown or KeyUp event of the NumericUpDown control.

 

Please let me know if this doesn’t work for you!

 

Best,

Levie

  • Glenn Gonzales
    Hi, This is my code if(e.Control is NumericUpDown) { var control = (NumericUpDown)e.Control; control.HideUpDownButtons = true; control.InterceptArrowKeys = false; control.SelectOnEnter = true; } But when I run, the behaviour is correct except, I can not type anything, the editor becomes readonly. Thanks.
  • Glenn Gonzales
    Hi, any update on this?
  • Levie (ITG)
    Hi Glenn, Yes, it’s a known bug, I mentioned it in an answer above. When setting InterceptArrowKeys to true it disables manual editing of the control. The issue is fixed and will be available in the next build! Sorry for the inconvenience. -Levie
  • Glenn Gonzales
    Hi, do we have an estimate as to when can this be fixed? Thanks.
  • Levie (ITG)
    Hi Glenn, the issue is fixed and will be available in the next build which should be released by the end of the week! Best, Levie
  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.