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

[Solved] databind command buttons routing not working

1 Answer 134 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.
quentinjs
Top achievements
Rank 1
quentinjs asked on 24 Sep 2010, 09:01 PM
I have the following for my script, the problem is that the "Select, "Add New", "Edit" all show the same route for the url.  And Delete doesn't show one. 

Select: http://localhost:4381/aaaaaa/Index/1?Search=test&showInActive=False&mode=select
Add: http://localhost:4381/aaaaaa?Search=test&showInActive=False&mode=insert
Edit: http://localhost:4381/aaaaaa/Index/1?Search=test&showInActive=False&mode=edit

And why does "Add" not show the Index? 

Now the ActionLink approach works find but the buttons don't.   Any reason why this is the case? Also what is there a "mode" parameter as this is redundant when using proper routing.  

    Html.Telerik().Grid(Model)
      .Name("Project")
      .PrefixUrlParameters(false)
      .ToolBar(commands => commands.Insert())
      .DataKeys(dataKeys => dataKeys.Add(c => c.ProjectId))
            .DataBinding(dataBinding =>
                             {
                                 dataBinding.Server()
                                     .Select("Index""aaaaaa",
                                             new
                                                 {
                                                     Search = (string) ViewData["Search"],
                                                     showInActive = (Boolean) ViewData["showInActive"]
                                                 });

                                 dataBinding.Server().Update("Edit""PPPP"new {});
                                 dataBinding.Server().Insert("Add""EEEE"new {});
                                 dataBinding.Server().Delete("Delete""FFFFF");
                             })
        //Template column which shows an action link
        .Columns(columns =>
        {
            columns.Command(commands => commands.Select()).Title("Select");
            columns.Template(o =>
            {
           
            columns.Command(commands =>
            {
                commands.Edit();
                commands.Delete();
            }).Width(180).Title("Commands");

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 27 Sep 2010, 08:00 AM
Hi quentinjs,

 We need additional information about this problem. Could you please attach a sample project which demonstrates the routing issue?

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