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

How can i get multiple actionlinks in one column using MVC

2 Answers 201 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 01 Jul 2015, 12:50 PM

I am trying to get my actionlinks to redner into one column.  Currently I have them all laid out in individual columns, but can't figure out how to merge them into one.

 

.Columns(columns =>
              {
                  columns.Bound(obcs => obcs.ProfileName).Title(xxx.Controllers.FieldTranslation.GetLabel("ProfileName", @xxx.DNetSynch.GlobalVariables.LanguageID));
                  columns.Bound(obcs => obcs.EEFinalize).ClientTemplate("#= EEFinalize ? 'Yes' : 'No' #").Title(xxx.Controllers.FieldTranslation.GetLabel("EEFinalize", @xxx.DNetSynch.GlobalVariables.LanguageID));
                  //columns.Bound(obcs => obcs.CCFinalize).ClientTemplate("#= CCFinalize ? 'Yes' : 'No' #");
                  columns.Bound(obcs => obcs.Completed).ClientTemplate("#= Completed ? 'Yes' : 'No' #").Title(xxx.Controllers.FieldTranslation.GetLabel("Completed", @xxx.DNetSynch.GlobalVariables.LanguageID));
 
 
                  columns.Template(@<text>
                    @Html.ActionLink(@item.ProfileID.ToString(), "Index", "OBProfileTasks", new { @item.ProfileID })
                </text>)
                      .ClientTemplate("<a class='k-button' href='./OBProfileTasks/Index/#= ProfileID#'>Tasks</a>")
                      .Title(xxx.Controllers.FieldTranslation.GetLabel("Tasks", @xxx.DNetSynch.GlobalVariables.LanguageID));
                       
                       
                  columns.Template(@<text>
                        @Html.ActionLink(@item.ProfileID.ToString(), "Index", "OBProfileTasks", new { @item.ProfileID })
                </text>)
                      .ClientTemplate("<a href='OBProfileTasks/Index/#= ProfileID#'><i style='color:black;' class='fa fa-plus fa-lg' title='Assign To Client'></a>")
                      .Title(xxx.Controllers.FieldTranslation.GetLabel("AssignToClient", @xxx.DNetSynch.GlobalVariables.LanguageID));
 
 
 
                  columns.Template(@<text>
                        @Html.ActionLink(@item.ProfileID.ToString(), "Replica", "OBProfile", new { @item.ProfileID })
                </text>)
                      .ClientTemplate("<a href='OBProfile/Replica/#= ProfileID#'><i style='color:green;' class='fa fa-clipboard fa-lg' title='Replicate'></a>")
                      .Title(xxx.Controllers.FieldTranslation.GetLabel("Replicate", @xxx.DNetSynch.GlobalVariables.LanguageID));
                       
                       
                  columns.Template(@<text>
                        @Html.ActionLink(@item.ProfileID.ToString(), "Delete", "OBProfile", new { @item.ProfileID })
                </text>)
                      .ClientTemplate("<a href='OBProfile/Delete/#= ProfileID#' onclick='return confirm_delete()' title='Delete'><i style='color:red;' class='fa fa-times fa-lg'></i></a> ")
                      .Title(xxx.Controllers.FieldTranslation.GetLabel("Delete", @xxx.DNetSynch.GlobalVariables.LanguageID));
                       
                       
                  columns.Command(command =>
                  {
                      command.Edit();
                     // command.Destroy().HtmlAttributes(new { @class = "onboard-delete " });
                  }).Title(xxx.Controllers.FieldTranslation.GetLabel("Controls", @xxx.DNetSynch.GlobalVariables.LanguageID));
 
              })

2 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 1
answered on 01 Jul 2015, 12:52 PM

Don't see where to edit, but these are the columns I'm concerned about merging into one

 

columns.Template(@<text>
                    @Html.ActionLink(@item.ProfileID.ToString(), "Index", "OBProfileTasks", new { @item.ProfileID })
                </text>)
                      .ClientTemplate("<a class='k-button' href='./OBProfileTasks/Index/#= ProfileID#'>Tasks</a>")
                      .Title(xxx.Controllers.FieldTranslation.GetLabel("Tasks", @xxx.DNetSynch.GlobalVariables.LanguageID));
                        
                        
                  columns.Template(@<text>
                        @Html.ActionLink(@item.ProfileID.ToString(), "Index", "OBProfileTasks", new { @item.ProfileID })
                </text>)
                      .ClientTemplate("<a href='OBProfileTasks/Index/#= ProfileID#'><i style='color:black;' class='fa fa-plus fa-lg' title='Assign To Client'></a>")
                      .Title(xxx.Controllers.FieldTranslation.GetLabel("AssignToClient", @xxx.DNetSynch.GlobalVariables.LanguageID));
  
  
  
                  columns.Template(@<text>
                        @Html.ActionLink(@item.ProfileID.ToString(), "Replica", "OBProfile", new { @item.ProfileID })
                </text>)
                      .ClientTemplate("<a href='OBProfile/Replica/#= ProfileID#'><i style='color:green;' class='fa fa-clipboard fa-lg' title='Replicate'></a>")
                      .Title(xxx.Controllers.FieldTranslation.GetLabel("Replicate", @xxx.DNetSynch.GlobalVariables.LanguageID));
                        
                        
                  columns.Template(@<text>
                        @Html.ActionLink(@item.ProfileID.ToString(), "Delete", "OBProfile", new { @item.ProfileID })
                </text>)
                      .ClientTemplate("<a href='OBProfile/Delete/#= ProfileID#' onclick='return confirm_delete()' title='Delete'><i style='color:red;' class='fa fa-times fa-lg'></i></a> ")
                      .Title(xxx.Controllers.FieldTranslation.GetLabel("Delete", @xxx.DNetSynch.GlobalVariables.LanguageID));

0
Dimo
Telerik team
answered on 03 Jul 2015, 06:40 AM
Hello Dan,

You can include multiple helpers or HTML elements in a single column template. Have you tried that? Let me know if you stumble upon anything.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or