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

[Solved] ToolBar commands doesn't render in version 2010.2 825 and MVC1

1 Answer 14 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.
Rodrigo
Top achievements
Rank 1
Rodrigo asked on 22 Sep 2010, 06:09 PM
I believe I found a bug in Telerik.Web.Mvc project, especifically in the method Html() of class GridToolBarCustomCommand and class GridToolBarInsertCommand when using version 2010.2 825 with MVC1. The insert commands or custom commands are not redered as you can see in code snippet below:

        public override void Html(Grid<T> context, IHtmlNode parent)
        {
#if MVC2
            GridUrlBuilder urlBuilder = new GridUrlBuilder(context);

            new HtmlTag("a")
                .Attributes(HtmlAttributes)
                .AddClass(UIPrimitives.Grid.Action, UIPrimitives.Button, UIPrimitives.DefaultState, UIPrimitives.Grid.Add)
                .Attribute("href", urlBuilder.Url(context.Server.Select, routeValues =>
                {
                    routeValues[context.Prefix(GridUrlParameters.Mode)] = "insert";
                }))
                .Html(this.ButtonContent<T>(context.Localization.AddNew, "t-add"))
                .AppendTo(parent);
#endif
        }

Is that code correct?

Thanks,

Rodrigo Moura

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Sep 2010, 07:14 AM
Hello Rodrigo,

 The Insert() command shouldn't have been visible in intellisense in the first place. Editing is not supported in MVC1. We will hide it from intellisense so it does not create confusion.
 I confirm that Custom commands are not rendered in MVC1 due to a bug. Fortunately the fix is simple:

  1. Open GridToolBarCommandBaseExtensions.cs
  2. Remove the #if MVC2 and #endif directives
  3. Open GridToolBarCustomCommand.cs
  4. Remove the #if MVC2 and #endif directives

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
Tags
Grid
Asked by
Rodrigo
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or