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

event after editform is closed

3 Answers 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dimitrios
Top achievements
Rank 1
Dimitrios asked on 02 Jun 2015, 11:40 AM

Hello,

I have a radgrid on a page with a custom control as an edit form.

Within the custom control, there is a button which among other things it also adds a record to another radgrid on the same page (not the parent of the custom control). The button closes the custom control with <editedItem.OwnerTableView.ClearEditItems()>.

On which event I must include the rebind command of that second radgrid?

Is there an event which fires when an editform is closed?

 Thanks for your time...

 

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 05 Jun 2015, 08:41 AM
Hello Dimitrios,

You can use the fireCommand method to execute a Cancel operation, which will raise the ItemCommand event of the grid:
http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-firecommand.html

Alternatively, you can use the FireCommandEvent method to achieve the requested functionality on the code-behind:
http://www.telerik.com/help/aspnet-ajax/grid-fire-command-event-from-code.html


Then, you can use the ItemCommand event handler to check the e.CommandName and handle your custom logic.

Hope this helps.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Dimitrios
Top achievements
Rank 1
answered on 08 Jun 2015, 05:09 AM

Hi Eyup,

Sorry man, but I do not understand...

As you noticed, the custom button is inside the Edit form (EditFormType="WebUserControl") of the grid.

So, the code of this button is in the ascx.vb file.

What GridCommand I would use for the FireCommand?

In other words, in the Item command, what would be the e.CustomName?

Forgive me if I don't understand, but maybe you should take a little more time reading my scenario above. 

 

--------------

I will tell you something a little more general.

Most of the time, you (the support people) throw us a link of the Telerik knowledge base which explains the relative topic, but the actual problem is rarely addressed!

Sorry, but this maybe save you time, but it does not serves the purpose...

 

Thanks

 

0
Eyup
Telerik team
answered on 11 Jun 2015, 05:52 AM
Hi Dimitrios,

After running the logic in the WebUserControl code-behind, you can access the container GridEditableItem using the this.NamingContainer directive. Once you have a reference to the grid item, you can use the FireCommandEvent method from the second link with command name "Cancel". This will cause the edit item to close and fire the ItemCommand event of the grid.

If you have different requirements or further instructions, could you create a new web site to demonstrate a very basic isolated version of your application? You can open a formal support ticket and send this runnable sample to us so we can debug and analyze the project locally.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Dimitrios
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Dimitrios
Top achievements
Rank 1
Share this question
or