NumericUpDown CellType question

Hi, Is it possible to restrict a "NumericUpDown" cell (CellType = NumericUpDown) so that its value can only be changed by the up/down buttons? I require that the cell value range from 100 upto 5000 in steps of 100 and that it must be a multiple of 100. (Eg. 100, 200,... 4900, 5000). Essentially I want to emulate the behaviour of the Windows forms NumericUpDown control which if the ReadOnly property is set to True a user can not type in a new value but CAN use the up/down buttons to increment/decrement the value. Thks in advance, Brian

2 Replies

AD Administrator Syncfusion Team January 18, 2006 07:35 AM UTC

Hi Brain, You can restrict the NumericUpDown cell, by using the NumericUpDown class. Here is the code snippet gridControl1[rowIndex, colIndex + 2].NumericUpDown = new GridNumericUpDownCellInfo(100, 5000, 100, 100, false); And you can able to cancel the editing, by using the KeyDown, KeyPress Events. Kindly refer to sample for details Let me know if you need futher assistance, Regards Madhan

Forum_39574_18Jan06.zip


BW Brian Walker January 18, 2006 11:50 AM UTC

Thanks Madhan - Works perfectly

Loader.
Up arrow icon