Telerik Forums
UI for ASP.NET MVC Forum
2 answers
735 views

Is there a way to disable drag and drop for tasks in the scheduler?

I want my users only to be able to edit tasks through the edit form.

/Jonas

Jonas
Top achievements
Rank 1
 answered on 19 Nov 2015
1 answer
180 views

I have a very simple listview that I cannot get to show any data. 

 View:

@(Html.Kendo().ListView<PortalContext.Root>()
                    .Name("leafView")
                    .TagName("div")
                    .ClientTemplateId("leafTemplate")                
                            .DataSource(dataSource => {
                                dataSource.Model(model => { model.Id(p => p.RootId);
                                                            model.Field<string>(f => f.ShortName);
                                });
                                dataSource.Read(read => read.Action("Leafs", "Home").Data("branchLevel"));
                            })
                )

 

    <script type="text/x-kendo-tmpl" id="leafTemplate">       
        <div style="height:100px">
            #: ShortName #
        </div> 
    </script>

I have a treeview that refreshes the data onSelect

 

function onSelect(e) {
        if (treeview.dataItem(e.node).IsBranch) {
            branchId = treeview.dataItem(e.node).id;            
            $("#leafView").data("kendoListView").dataSource.read();
        }
    }

    function branchLevel() {
        return {
            branchId: branchId            
        };
    }

I have simplified a few things but my controller looks like this and is basically returning a list of objects.

public ActionResult Leafs([DataSourceRequest]DataSourceRequest request, int? branchId) {

            return Json(ViewModel.Roots.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}

 

Any ideas why this may not be working?

 

Bill

William
Top achievements
Rank 1
 answered on 18 Nov 2015
8 answers
1.5K+ views

I use the Ajax Editing to manage the record in my grid .
I would like call the controller before edit the selected record to check if the record is not lock.
I would like have this process :
   - Click on "Edit" buttom on grid,
   - Call the action controller to check the lock,
       -> If record lock, Abort Edit record,
       -> If record is not lock, Edit record.
 Do you know of a great way to make this process ?
Thanks
I set up a simple grid like this using the Razor syntax:

@(Html.Kendo().Grid<GridCustomPopupTemplate.Models.Person>().Name("persons")
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model => model.Id(m => m.PersonID))
        .Read(read => read.Action("GetPersons", "Home"))
        .Update(up => up.Action("UpdatePerson", "Home"))
    )
    .Columns(columns =>
    {
        columns.Bound(c => c.PersonID).Width(200);
        columns.Bound(c => c.Name);
        columns.Command(cmd => {
            cmd.Edit();
            });
    })
    .Pageable()
    .Sortable()
    .Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("Person"))
)

Boyan Dimitrov
Telerik team
 answered on 18 Nov 2015
16 answers
203 views

Hello, is it possible to have a "Preview Row" (see attached picture) with MVC Grid?

robert

Robert Madrian
Top achievements
Rank 1
Veteran
Iron
 answered on 18 Nov 2015
5 answers
169 views
Hi,
Is it possible to have a grid bound to a signalR datasource and use inline editing?  I've set up my grid to be bound to a signalR datasource and it is successfully bound and I can update the data.  I am unable to get it to work with inline editing and also I cannot get it to update other instances of the grid.  My application is an MVC 5.1 application and I am running on Visual Studio 2012.  The Telerik version I am using is 2014.1.415.  So can you please answer the following:
1. Can the grid have inline editing but still be bound to a signalR datasource ?  If so, can you give an example?
2. Why aren't other instances of my grid updating with the changes?  Any things I can check?  I've followed your example and it seems I'm doing everything the same.

Please help.
Vladimir Iliev
Telerik team
 answered on 18 Nov 2015
5 answers
723 views

I need to stop collapsing a detail row in kendo grid in some cases, but my code is not working:

var detailGrid = $("#grid-details").kendoGrid({
           < ....>
            detailCollapse: function (e) {
                //operator.views.common.CheckDetailsRow(e.detailRow);
                e.preventDefault();
                return false;
            },

<......>
                   }).data("kendoGrid");

Boyan Dimitrov
Telerik team
 answered on 18 Nov 2015
1 answer
1.2K+ views

Hi,

I have a Kendo Grid in which I use Data method in Read.Action to pass parameters to a controller action. The code is:

<% Html.Kendo().Grid<EvaluationsQuestionsEvaluationPillarsGridViewModel>()
            .Name("Pillars")
            .DataSource(dataSource => dataSource
                  .Ajax()
                  .Model(model => model.Id(a => a.EvaluationMasterPillarId))
                  .ServerOperation(true)
                  .Read(read => read.Action("LoadEvaluationsQuestionsEvaluationPillarsGridAjax", "Evaluations")
                                    .Data("onLoadEvaluationsQuestionsEvaluationPillarsGridData"))
             )​
......

        function onLoadEvaluationsQuestionsEvaluationPillarsGridData(e) {
            var evaluationVersionId = $('#evaluationVersionId').val();  // "evaluationVersionId" is set beforehand
            var showDeletedCheckbox = $('#Checkbox1').val();

            return { evaluationVersionId: evaluationVersionId, showDeleted: showDeletedCheckbox }
        }

        public ActionResult LoadEvaluationsQuestionsEvaluationPillarsGridAjax(DataSourceRequest request, string evaluationVersionId, bool showDeleted)
        {
......

But the controller action "LoadEvaluationsQuestionsEvaluationPillarsGridAjax" is not even invoked. I need help on this. Thanks.

 

Dimiter Madjarov
Telerik team
 answered on 18 Nov 2015
1 answer
2.4K+ views

​Hi there, I was wondering if someone could help me.  How can I bind my dropdown list to a viewbag to ensure it's getting it's data from the right place?  I found a couple of guides but they didn't work for my scenario.  Here is my code.

// #DDL - Broker Companies
       
      IEnumerable<SelectListItem> thestats = seabrokersData.tbl_requirement_status
           
          .Select(c => new SelectListItem
          {
              Value = c.id.ToString(),
              Text = c.thet_status
          });
      ViewBag.theStatus = theStatus;

 

I would like my Kendo Dropdown to use the above viewbag to populate itself.  How can I do this?

Many thanks

 

 

 

Boyan Dimitrov
Telerik team
 answered on 18 Nov 2015
2 answers
279 views

I'm having some accessibility issues with my Kendo MVC Grid. When using the Tab button I am unable to access the pages options at the bottom left corner of the grid. After looking over your documentation I've seen that pressing ALT + Page Up or ALT + Page Down should allow me to move through the pages. Unfortunately this does not work and I'm unsure what may be causing this issue. Here is an example of my code.

        @(Html.Kendo().Grid<AuthDTO.ListUserManagement>()
              .Name("ManageUsersGrid")
              .HtmlAttributes(new {style = " width:100%; height:86%"})
              .Pageable()
              .Pageable(pageable => pageable
                .PageSizes(true)
                .Messages(msg => msg.Display("{0:d0} - {1:d0} of {2:d0} items"))
                .Refresh(true))
              .Reorderable(reorder => reorder.Columns(true))
              .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))
              .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
              .ColumnMenu()
              .ColumnResizeHandleWidth(10)
              .Resizable(resizable => resizable.Columns(true))
              .Scrollable(o => o.Height("100%"))
              .DataSource(dataSource => dataSource
                  .Ajax()
                  .Read(read => read.Action("GetUsers", "AppUser", new RouteValueDictionary {{"area", "AppUser"}}))
              )
              .Columns(columns =>
              {
                  columns.Bound(o => o.Id)
                      .Filterable(false)
                      .Width(100)
                      .IncludeInMenu(false)
                      .Sortable(false)
                      .Title("Actions")
                      .ClientTemplate(
                          "# if(" + @ViewBag.DOD + " == 'true')  { # +" +
                          "<a href=\"javascript: void(0);\" onclick=\"userEditItem('#: Id #');\" title=\"Edit\"><i class=\"disabled fa fa-pencil-square-o fa-lg\"></i><span class=\"sr-only\"></span></a>"
                          + "# } else { # " +
                          "<a href=\"javascript: void(0);\" onclick=\"userEditItemCAC('#: Id #');\" title=\"Edit\"><i class=\"active fa fa-pencil-square-o fa-lg\"></i><span class=\"sr-only\"></span></a>"
                          + "# } #" +
                          "<a href=\"javascript: void(0);\" onclick=\"impersonate('#: Id #');\" title=\"Impersonate User\"><i class=\"active fa fa-user fa-lg\"></i><span class=\"sr-only\"></span></a>"
                      );
                  columns.Bound(o => o.LastName)
                      .Width(200)
                      .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
                  columns.Bound(o => o.FirstName)
                      .Title("First Name")
                      .Width(200)
                      .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
                  columns.Bound(o => o.Email)
                      .Title("Email")
                      .Width(250)
                      .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
                  columns.Bound(o => o.Phone)
                      .Title("Phone")
                      .Width(250)
                      .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
                  columns.Bound(o => o.Organization)
                      .Title("Organization")
                      .Width(250)
                      .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
                  columns.Bound(o => o.Active)
                      .Title("Active")
                      .Width(100)
                      .Filterable(false);
                  columns.Bound(o => o.LockedAccount)
                      .Title("Locked Account")
                      .Width(100)
                      .Filterable(false);
                  columns.Bound(o => o.LockoutDateTime)
                      .Title("Lockout Date Time")
                      .Width(200);
              })

              )

 




Justin
Top achievements
Rank 1
 answered on 17 Nov 2015
1 answer
69 views

Hello,

I have a problems with @(Html.Kendo().Editor() in Vistual Studio 2015 ASP.NET 5 MVC 6 beta 8 with "Kendo.Mvc : 2015.3.1111".

No overload for method '​Editor' takes 0 arguments

When will it be available?

Best Regards

Davide

Dimiter Madjarov
Telerik team
 answered on 17 Nov 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?