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

[Solved] Window in Grid Row

1 Answer 98 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
StevenDale
Top achievements
Rank 2
StevenDale asked on 20 Mar 2012, 03:20 AM
I want to put a custom command in a grid row. When the button is clicked I want to open a Modal Window to be able to enter some form information pertaining to the item from the row. Then I want to be able to save the data on the window using an Ajax call and then close the window.

1. Is this possible?
2. Do you have any examples of how to accomplish this?

Currently I have custom command button which navigates me to another view where I perform my form entry and then I navigate back to my original page but the row that I had selected is lost.

Thanks,

Billy Jacobs

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Mar 2012, 01:16 PM
Hello Billy,

I posted my reply in the support ticket you have opened. For convenience, I am pasting it below:

*******************************************************************************************************************

This should be possible but I am not sure if understand the exact scenario. Could you clarify? Should the form in the modal Window be empty or it should contain some information that needs to be requested from the server or populated from the row's record? Is the Grid using Server or Ajax binding?
As general information:
  1. you can use the Grid's OnCommand client-side event and get the row's item from  event argument's dataItem property if the Grid is Ajax bound. If it is Server bound, you could use a custom button in the Template and set the parameter to the onclick event from the model.
  2. You can use the Window client-side open and close methods to open it and later to close it in the Ajax request success callback.
  3. The record ID can be set to a hidden input and posted with the rest of the form's data or you can save it and then add it as additional data when submitting the form.

*******************************************************************************************************************

All the best,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Window
Asked by
StevenDale
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Share this question
or