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

[Solved] Position of popup edit window

9 Answers 499 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mattias
Top achievements
Rank 1
Mattias asked on 29 Apr 2011, 08:09 AM
Hi,
My popup window is positioned slightly to the right of the center of the screen which I don't like.
I have removed all custom css files to see if there was anything I have done, but still the same.
I want the window to be at the center of the screen. Is there a way to manually position the window?

@{Html.Telerik().Grid(Model.Items)
        .Name("Grid")
        .DataKeys(keys => keys.Add(x => x.ID))
        .ToolBar(commands => commands.Insert())
        .EnableCustomBinding(true)
        .PrefixUrlParameters(false)
        .DataBinding(dataBinding =>
        {
            dataBinding.Server()
                .Select("Index", "Menu")
                .Insert("Insert", "Menu")
                .Update("Update", "Menu")
                .Delete("Delete", "Menu");
        })
        .Editable(editing => editing.Mode(GridEditMode.PopUp))
         
        .Columns(columns =>
        {
            columns.Bound(x => x.Name).Title(Resources.Application.MenuName);
            columns.Bound(x => x.Url).Title(Resources.Application.Url);
            columns.Bound(x => x.IsEnabled).Title(Resources.Application.IsEnabled);
            columns.Bound(x => x.CreateDate).Title(Resources.Shared.CreateDate).Format("{0:g}")
                .HeaderHtmlAttributes(new { @class = "right" })
                .HtmlAttributes(new { @class = "right" });
             
            columns.Command(commands =>
                {
                    commands.Edit();
                    commands.Delete();
                }).Width(200).Title("").HtmlAttributes(new { @class = "right" });
        })
        .Render();
        }

Regards,
Mattias

9 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 29 Apr 2011, 08:15 AM
Hello Mattias,

 By default the popup is centered in the grid. You can center it in the browser window by following the approach from the "Center PopUp Edit Form" code library project.

Best wishes,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Mattias
Top achievements
Rank 1
answered on 29 Apr 2011, 08:37 AM
Hi Atanas,
Center it in the grid is just fine, the problem is still the same, my popup isn't centered to the grid!
When looking again it seems the popup is styled with fixed position of the browser. If I resize the browser the popup is still on the same position.
0
Mattias
Top achievements
Rank 1
answered on 29 Apr 2011, 08:43 AM
Hi again,
I think I found the problem!
It must be the editor in the popup the causes it. If I set the width of the window to for example 700 pixels, the window is centered.
Bug or a "feature"? :)
0
Atanas Korchev
Telerik team
answered on 29 Apr 2011, 09:05 AM
Hi Mattias,

 I don't think I understand the problem. Could you clarify?

All the best,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Alexander
Top achievements
Rank 1
answered on 20 Jun 2011, 09:16 PM
the example above works fine for edit, bu how can i center the form for "add new"?

Thanks,
Alex
0
Atanas Korchev
Telerik team
answered on 21 Jun 2011, 08:05 AM
Hi Alexander,

 The same code will work with adding new records because the OnEdit event is raised in that case too.

Regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Srikanth
Top achievements
Rank 1
answered on 04 Dec 2011, 06:43 PM
hiiii,
Mattias
                  iam beginner of asp.net the way u designed ur page is simply superb can u plas share ur code with me it will be helpfull for me to learn  iam using C# as the domain in ASP.net..... pls do share ur code of both design and logic.... if u can....
THANKS IN ADVANCE
MY MAIL ID IS: sri.reddy276@gmail.com
0
jfkrueger
Top achievements
Rank 1
answered on 21 Jun 2012, 09:06 PM
How do you set the width of the popup window?? My popup window also is not even close to being centered over the grid. It is basically just hugging the right side of the screen and sometimes even goes off the screen. I do have three editors in my editor template.

Thanks!
0
jfkrueger
Top achievements
Rank 1
answered on 21 Jun 2012, 09:17 PM
Followup: It does look like it has something to do with the editors in the grid because if I set the width of the editors in the shared editor template it is much closer to being centered and not always hugging the right-hand side of the screen. This in combination with the link on centering the window solved my issue.
Tags
Grid
Asked by
Mattias
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Mattias
Top achievements
Rank 1
Alexander
Top achievements
Rank 1
Srikanth
Top achievements
Rank 1
jfkrueger
Top achievements
Rank 1
Share this question
or