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

how do I know when the expression editor is closed?

2 Answers 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 25 Oct 2012, 02:57 PM
I would like to be able to use the expression editor as a stand-alone component.  I've been playing with both the WinForms and WPF versions.

I do realize the WinForms version doesn't directly support standalone operation, so what I've done is created a RadGridView and made it invisible.  I add some columns programmatically, and enable expression editing on the first one (only).
Then I have a button which launches the expression editor:
    RadExpressionEditorForm.Show(grid1, grid1.Columns[0]);

Which does bring up the expression editor, and I see the other columns I've defined in the "Fields" list.

But the method RadExpressionEditor.Show() method is not modal -- it returns immediately, and I don't see an alternate ShowDialog() signature.  Also, the method returns void, so I don't know whether the user pressed Cancel or OK.

I'm guessing that what I should do is handle some event on the grid view to know when the dialog has been dismissed ... but I've tried several, including CellValueChanged() and CellEndEdit(), and they don't ever seem to get called.

What am I doing wrong?!?

2 Answers, 1 is accepted

Sort by
0
Accepted
Svett
Telerik team
answered on 29 Oct 2012, 03:02 PM
Hello David,

In the latest release, we have exposed the RadExpressionEditorForm and now it can be instantiated. Then you can handle the FormClosed event, where you can perform your operation:
RadExpressionEditorForm form = new RadExpressionEditorForm(this.radGridView1.Columns[0]);
form.FormClosed += new FormClosedEventHandler(form_FormClosed);
form.ShowDialog();

I recommend using at least Q3 2012 (2012.3 1017). Kind regards,
Svett
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
0
David
Top achievements
Rank 1
answered on 30 Oct 2012, 01:11 PM
Thank you.

That snippet really, really, really needs to be included in the online documentation :)
Tags
GridView
Asked by
David
Top achievements
Rank 1
Answers by
Svett
Telerik team
David
Top achievements
Rank 1
Share this question
or