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

Spinner editor step configuration

2 Answers 86 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Philippe
Top achievements
Rank 2
Philippe asked on 12 Jul 2012, 01:12 PM
Hello.

I would like to know how to configure the spinner's step value properly in a GridView. I need the spinner to move the values by 0.01 instead of 1. The demo application and a forum search didn't solve the problem.

Closest I have come to is this code, but it doesn't work:
private void radGridViewBase_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            var editor = this.radGridViewBase.ActiveEditor as GridSpinEditor;
            if (editor != null)
            {
                editor.Step = 0.01M;
            
        }

Thanks
Philippe

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Petrov
Telerik team
answered on 16 Jul 2012, 01:45 PM
Hi Philippe,

Thank you for writing.

The best place for modifications of the editor of a given cell is the CellEditorInitialized event. There you can change the step of the editor. Here is an example:
private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
  GridSpinEditor editor = e.ActiveEditor as GridSpinEditor;
 
  if (editor != null)
  {
    editor.Step = 0.01m;
  }
}

I hope this will help. Should you have further questions, I would be glad to help.

Greetings,
Ivan Petrov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Philippe
Top achievements
Rank 2
answered on 16 Jul 2012, 03:17 PM
Works like a charm. Thanks alot!
Tags
GridView
Asked by
Philippe
Top achievements
Rank 2
Answers by
Ivan Petrov
Telerik team
Philippe
Top achievements
Rank 2
Share this question
or