[SOLVED] Hide the Spinner for Numeric UpDown control

Answered
0
0

Hi,

 

Is it possible to hide the spinner(up/down) button in numericupdown control for both editor and in datagridview? If possible how to do it?

 

Thank you.

  • You must to post comments
Best Answer
0
0

Hi Glenn,

 

You can achieve this behavior in several different ways.

First way:

Add this line of code to hide the up button:

this.numericUpDown1.Eval(“this.getChildControl(‘upbutton’).hide()”);

Note: You will need to perform this everytime the control refreshes.

 

Second way:

Add the attached JS file to your solution.

Add “spinner-nobuttons” to the AppearanceKey property of your NumericUpDown control.

You can play around with the properties inside of the JavaScript file to get the requested behavior!

 

I hope these help!

Let me know if you have any more questions!

 

Best,

Levie

 

  • You must to post comments
0
0

Thank you it is working now.

  • You must to post comments
0
0

Hi,

 

I want to use this this.numericUpDown1.Eval(“this.getChildControl(‘upbutton’).hide()”); to hide the up/down button for the numeric spinner control, but how to apply it to a column in DataGridview.

 

Thank you.

  • Levie (ITG)
    Hi Glenn, add an event handler for EditingControlShowing in your DataGridView and add the following code: private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { NumericUpDown ctrl = (NumericUpDown)dataGridView1.EditingControl; ctrl.Eval(“this.getChildControl(‘upbutton’).hide()”); } I hope this helps! Best, Levie
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.