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

Grid Edit PopUp Window - Center on Resize

1 Answer 223 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Iron
Greg asked on 29 Mar 2016, 03:55 PM

I have a Kendo Grid that is formatted to edit in a popup window with a custom template:

.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("MyEditor").Window(w => w.Resizable().Events(e => e.Resize("popupResize"))))

That popup edit window template ("MyTemplate") has multiple controls on it which includes a Kendo TabStrip.  One of the tabstrip items contains another Kendo Grid.  Depending on the datasource of that grid, the width and height of the popup window may change.  This may even take the edit popup window partially off the screen.

The problem is that the Resize event (which I'm subscribing to as shown above) of the grid popup window doesn't fire when the window's size changes due to changes in the content.  It only fires if the user resizes the window with their mouse.

Is there a way to know when the content width/height of a popup edit window changes so I can call the center() method on the edit popup window?

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 31 Mar 2016, 11:13 AM
Hello Greg,

The resize event of the Kendo UI Window is fired only when the widget is resized by the user. There are couple of other events you can handle, depending on when exactly the Grid that is inside the TabStrip is populated with data and expands the Kendo UI Window.

You can use either the activate event of the TabStrip or dataBound event of the Grid, get a reference to the closest parent Kendo UI Window and center it in the handler.

An alternative approach would be to set fixed dimensions for the Window (.Width(...).Height(...)) and make the Grid scrollable (...Scrollable(True)), so you would not need to center the Window every time the Grid comes up with different size.

Let me know if you need further assistance.

Regards,
Dimiter Topalov
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
Greg
Top achievements
Rank 1
Iron
Answers by
Dimiter Topalov
Telerik team
Share this question
or