Telerik Forums
UI for ASP.NET MVC Forum
3 answers
117 views

Hi,

When I edit an activity in my gantt I have many fields in the popup edit including a multiselect. This multiselect should be different for each activity.

For load the datasource I put the code below in my function Gantt edit :

<p> $.get('/Activity/ReadMultiSelectActivities?initiativeId=' + @Model.ID + '&excludeSectorId=' + $('#SectorID').val() + "&activityID=" + e.task.id, function (data, status) {<br>   allActivitiesDataSource = new kendo.data.DataSource({<br>       data: data.Data,<br>      group: { field: "SectorName" },</p><p>       sort: { field: "ActivityNumberString", dir: "asc" }<br>   });<br>});</p>

When I go the first time on my edit activity the list is empty but if I go an second time the list is OK. Then if I go on an other activity, the previous list is displayed.

It's like my list is charge after the display of my popup edit.

I try many things. Like use refresh(), data.read(), put some code in the multiselect Databound... But nothing work!

 

Do you know how to do it please?

 Thanks for advance

Nencho
Telerik team
 answered on 25 May 2017
3 answers
209 views

I used the MVC example which works perfect as-is I rewrote to work with a JSON request and it ALSO works fine, however when I try to view the data in a string it is trying to display the OBJECT and not the data inside the object. I ASSUMED that the SelectedData is also in JSON format becuase the MultiSelect datasourse is a JSON object.  

 

@(Html.Kendo().MultiSelect()
         .Name("GridSelect")         
         .AutoClose(false)
         .Placeholder("Select Which Grids to Print...") 
         .DataTextField("MapName")
         .DataValueField("Pagenumber")
         .DataSource(source =>
                     {
                         source.Read(read =>
                         {
                             read.Action("GetCascadeGrid100", "GridPrint")
                             .Data("filterGrid100");
                         })
                         .ServerFiltering(true);
                     })       
   )

 

 

So my issue is when I create click button function and I want to display the selected items..  here is what I have tried and the results.  I just want to display my data in a string   Mapname:1 PageNumber:234, Mapname:3, PageNumber:3244 etc...  

 

$(document).ready(function () {
              
            var Gridselect = $("#GridSelect").data("kendoMultiSelect");
 
 
            
 
            $("#get").click(function () {
 
              alert( Gridselect.value + ",  "  + Gridselect.text + ",");
  // this displays nothing but the commas
 
// Also have tried
 
               var output = '';
                for (var entry in Gridselect) {
                    output += 'key: ' + entry + ' | value: ' + Gridselect[entry] + '\n';
                }
 
                alert(output);
// This displays a bunch of data but none of my values, it seems to parse the PageNumber and the MapName so there is something in there.
 
// Also Tried 
 
            alert(Gridselect.toSource);
 
 
            });
});

 

Konstantin Dikov
Telerik team
 answered on 25 May 2017
2 answers
211 views

I have an editable grid using InCell as the Edit Mode.  I have one field that is editable.  When that cell gets focus I want it to select the contents of the cell.  So for instance if the cell contains "100" and it gets focus I want the "100" to be selected so that the user can type over it with out having to backspace.   I have tried putting a this.select();  in the onEdit Code when that column is being edited but it isn't working.

Thx for help

Lee

Lee
Top achievements
Rank 1
 answered on 24 May 2017
5 answers
615 views

I am trying to capture the filter event in my Kendo grid as we are saving grid state in Local storage using Angularjs.  Server-side filter works, but the "filter event" on the grid does not fire.  Is there something more I need to do? Here is a code snippet

              pageSize: 25,
              serverPaging: true,
              serverFiltering: true,
              serverSorting: true
          }),
          width: "100%",
          sortable: true,
          reorderable: true,
          pageable: true,
          columnMenu: false,
          resizable: true,
          filterable: true,
          filter: function(e) {
              if (e.filter == null) {
                  console.log   ("filter has been cleared");
              } else {
                  console.log(e.filter.logic);
                  alert(e.filter.filters[0].field);
                  console.log(e.filter.filters[0].operator);
                  console.log(e.filter.filters[0].value);
              }
          },

Boyan Dimitrov
Telerik team
 answered on 24 May 2017
1 answer
235 views

you can set save / cancel buttons text buy UpdateText and CancelText of command.Edit()

columns.Command(command => { command.Destroy().Text(" "); command.Edit().HtmlAttributes(new { style = " " }).Text(" ").UpdateText("Сохранить").CancelText("Отмена"); }).Width(100);

 

what if I need only delete button present in grid? (so user can add or delete items)?

if I remove edit command I will get default button names. If I set command.Edit(). HTMLAttributes display to none I will get no edit button but also I get NO save update buttons in popup

Preslav
Telerik team
 answered on 23 May 2017
3 answers
396 views

I am using Kendo Spreadsheet for ASP.Net MVC and using it inside the Kendo window.

I need to customize the spreadsheet toolbar to add a custom button (Save) option for the users to save the spreadsheet.

I could see the reference for toolbar customization using Kendo UIJavascript , but not with MVC. Please suggest how to add a custom button in spreadsheet toolbar using MVC.

 

Nencho
Telerik team
 answered on 23 May 2017
1 answer
1.1K+ views

This seems like it should be fairly simple and yet here I am.

I have a grid with inline editing.  I have set an editor template for a column to have a dropdown list.  This column is bound to a property that is set according to an enum.  All of that works great, and I get a dropdown with the names.

However, it always posts to the database as null.  All I want is the dropdown to show names when editing, post the value when creating or editing, then display the name when just viewing.

I have scoured forums but continue to come up empty.

Model

public class Issue
{
    public int Id { get; set; }
    ...
    ...
    public Urgency? Urgency { get; set; }
    ...
    ...
}

 

Enum

public enum Urgency
{
    Low = 1,
    Medium = 2,
    High = 3,
    Critical = 4
}

 

EditorTemplate View

@(Html.Kendo().DropDownList()
        .Name("Urgency")
        .BindTo(Enum.GetNames(typeof(Urgency)).ToList())
)

I have tried many other things but this is where my code is at the moment.

 

What am I missing?

Georgi
Telerik team
 answered on 22 May 2017
1 answer
345 views

I'm trying to implement filter checkboxes with my dynamic column grid. I return a List<string> of options that I retrieve based on the PropertyName that I pass to the read action of the Filterable property.

I keep getting the following javascript error, where X33 is the generic column name that is mapped to the actual data column. Any advice would be great.

VM2049:3 Uncaught ReferenceError: X33 is not defined
    at eval (eval at compile (kendo.all.min.js:25), <anonymous>:3:209)
    at Object.render (kendo.all.min.js:25)
    at Object.d [as render] (jquery.min.js:2)
    at init.createCheckBoxes (kendo.all.min.js:43)
    at init.refresh (kendo.all.min.js:43)
    at init.options.forceUnique.checkChangeHandler (kendo.all.min.js:43)
    at init.trigger (kendo.all.min.js:25)
    at init._process (kendo.all.min.js:28)
    at init.success (kendo.all.min.js:27)
    at success (kendo.all.min.js:27)
 

Here is the relevant code for setting up the columns.

foreach (ColumnSettings col in Model.GridColumns)
{
     columns.Bound(col.PropertyName).Title(col.Title).Width(col.Width).Filterable(ftb => ftb.Multi(true)
         .DataSource(ds => ds.Read(r => r.Action("Unique", "Data").Data("{ field: '" + col.PropertyName + "' }"))));
}

 

Preslav
Telerik team
 answered on 22 May 2017
16 answers
2.7K+ views
Hello,

I've added a custom command, "Details", to the rows in my grid so a user can view the details about the row.  When clicked, I want it to access the Details action in my HomeController.  However, when I build my solution, I receive the following error message:

"Custom command routes is available only for server binding."

Can someone please tell me how I can correct this issue?  My ulitimate goal is to create custom command buttons for Add, Edit, Delete, and Details, so my existing Views will be presented, rather than using the inline editing.  I need to create these custom buttons because the default command buttons don't seem to permit routing to my Views.  Anyway, I would appreciate your help.

Thanks,
Mike

      .Columns(columns =>
      {
          columns.Command(p => { p.Custom("ViewDetails").Action("Details", "Home").Text("Details"); }).Width(160);
          columns.Bound(p => p.CustomerId)
      })
Boyan Dimitrov
Telerik team
 answered on 22 May 2017
1 answer
159 views
Anyone know how I can get my grid to auto expand it's width when the browser width changes? I have two grids left and right of each other. I would like the left grid to auto size it's width and the right grid to be 400px. I can't seem to do this. I tried setting the right grid to float:right and it's always wrapping down to the bottom. The ultimate goal is to have the right grid disappear if the browser width is less than 768px. For that I was going to use the responsive web control, but first I think I need the left grid to auto size properly. Then if the right grid disappears the left grid will fill the remaining space. Any ideas would be greatly appreciated!
Stefan
Telerik team
 answered on 22 May 2017
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
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
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?