cell double click to open a new form

2 posts, 0 answers
  1. AJing
    AJing avatar
    19 posts
    Member since:
    Jun 2011

    Posted 24 Nov 2011 Link to this post

    Hi:
       How to open a new form when cell-double click in RadGridViwe?
       It seems that it only fires if the cells column is readonly.,but if the cell in editmode ,the cell-double click does not occur  .

      My user want to:
      1. Cell is put into editmode when cell-double click
      2. Cell is put into focus when cellclick
      3. User can edit cell or open a new form when cell-double click.

      We use 2011Q2 official version

    Greetings
    Look forward to you
    AJing.
  2. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 28 Nov 2011 Link to this post

    Hi Ajing,

    Thank you for writing.

    I am getting straight to your questions.

    1. This is the default behavior of the grid, when not in edit mode. When clicked a cell with the first click it will become current cell and with the second click it will get into edit mode.

    2. This is the default behavior of the grid, when you click a cell it it set as current, keeping its previous state - in edit mode or not.

    3. The CellDoubleClick event will get fired if RadGridView is not in edit mode. If the cell is in edit mode, you will have to subscribe to the DoubleClick event of the editor of the edited cell. For example for text box editor, you have to subscribe to the DoubleClick event of the hosted text box:
    void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        RadTextBoxEditor editor = e.ActiveEditor as RadTextBoxEditor;
        if (editor != null)
        {
            RadTextBoxEditorElement element = editor.EditorElement as RadTextBoxEditorElement;
            element.TextBoxItem.HostedControl.DoubleClick += new EventHandler(HostedControl_DoubleClick);
        }
     
    }
     
    void HostedControl_DoubleClick(object sender, EventArgs e)
    {
        //do something
    }

    I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
     
    Regards,
    Stefan
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Back to Top