Telerik Forums
UI for ASP.NET MVC Forum
1 answer
112 views
I followed the instructions here and successfully created a custom command column which displays some text in a popup window.  The next step in what I'd like to do is to have the user able to edit something  on the window shown by that custom command and update the datasource.  How can this be accomplished?

In other words, how can I add, for example, a DatePickerFor a particular field in the model and have a button click send that data back for update?  The model being used is a list of items so it would have to be a DatePicker for the current item in the list.
Daniel
Telerik team
 answered on 02 Jul 2013
1 answer
313 views
Hi, 

I have a column chart which does not show the legend even though I have set legend.Visible to true. If I uncomment the .Group line commented in the code below, then the legend starts showing, but unfortunately it displays the default colors rather than those I have customised with m => m.UiColor
                        
@(Html.Kendo().Chart<WorkItemStatusSummary>()
                      .Name("Chart")
                      .Legend(legend => legend
                          .Visible(true)
                          .Position(ChartLegendPosition.Bottom))
                      .DataSource(ds => ds
                        .Read(read => read
                            .Action("DummyAction", "DummyController")
                            .Data("ChartAdditionalFilterData"))
                        //.Group(g => g.Add(m => m.Status))
                      )
                      .Series(series => series.Column(m => m.Count, m => m.UiColor).Name(""))
                      .CategoryAxis(axis => axis
                                                .Categories(m => m.Status)
                      )
   )
Iliana Dyankova
Telerik team
 answered on 02 Jul 2013
0 answers
156 views
I recently updated several nuget packages in my MVC4 solution. After the update none of the kendo styles or js files were being found. I narrowed it down to the bundling, and identified it was an update to "Microsoft ASP.NET Web Optimization Framework" 1.1.0

The release notes (http://aspnetoptimization.codeplex.com/releases/view/101096) has a section at the bottom that explains why.

I thought of 3 potential solutions:
  1. Change the IgnoreList to be applied to the new directory filters instead (I didn't try this one)
  2. Include the kendo css and js files without using wildcards (tried this one and it works)
  3. Include the non-minified versions of the files, taken from the 'src' folder, in my solution (tried this one and it works)

I've ended up using option 3 as it seems to work best with the intention of how the MV4C bundling should work (non-minified used in debug so can debug into kendo code, and then minified version used in release).

I'm mainly posting to help anyone else who hits this problem, but if anyone has any suggestion why option 3 is not a good option I'd like to hear.

Also Kendo should probably update the documentation as the current IgnoreList approach no longer works.

Alex
Top achievements
Rank 1
 asked on 02 Jul 2013
5 answers
596 views
I have a DropDownList that, depending on another value, has anywhere from 5 to 15 values in it and there are about 20-25 total possible values.
It seems a bit ridiculous to go back to the server to get the proper data.
What I would like to do is render ALL of the items to the browser (as an array or something?) and do the filtering on the browser in javascript.
Has anyone done anything like this?  I can't find any examples of cascading DropDownLists that don't have ServerFiltering turned on.
jasonxz
Top achievements
Rank 1
 answered on 01 Jul 2013
1 answer
107 views
Hi,

I'm trying to create a menu in my MVC 4 _Layout.cshtml file.

I started from the example and I hacked it up to show the structure I want.  The problem is that when I use the syntax:
children.Add().Text("Application Home").Action("Index", "Home");

Sometimes the menu item is placed correctly with the action wired up.  Other times the action appears to be causing some kind of error, (page compiles fine), but the item is not shown.  If I remove the Action method, the 
item shows up where it's supposed to.

I've attached the entire menu code.  Can someone please help?

001.@(Html.Kendo().Menu()
002.          .HighlightPath(true)
003.          .Name("Menu")
004.          .Items(items =>
005.          {
006.            items.Add()
007.                .Text("Home")
008.                .Items(children =>
009.                {
010.                    children.Add().Text("Website Home");
011.                    children.Add().Text("Application Home").Action("Index", "Home");
012.                });                                     
013. 
014.              items.Add()
015.                  .Text("Company")
016.                  .Items(children =>
017.                   {
018.                       children.Add().Text("Events")
019.                               .Items(innerChildren =>
020.                               {
021.                                   innerChildren.Add().Text("List");
022.                                   //.Action("Index", "CompanyEvents");
023.                                   innerChildren.Add().Text("Calendar View");
024.                                   //.Action("Calendar", "CompanyEvents");
025.                               });
026. 
027.                       children.Add().Text("Departments");
028.                           //.Action("Index", "Department");
029. 
030. 
031.                       children.Add().Text("Configure")
032.                              .Items(innerChildren =>
033.                              {
034.                                  innerChildren.Add().Text("Benefit Year");
035.                                      //.Action("Index", "BenefitYear");
036.                                  innerChildren.Add().Text("Employee Types").Action("Index", "EmployeeType");
037.                                  innerChildren.Add().Text("Holidays").Action("Index", "Holiday");
038.                                  innerChildren.Add().Text("Job Codes").Action("Index", "JobCode");
039.                                  innerChildren.Add().Text("PTO Request Status Codes").Action("Index", "RequestStatusCode");
040.                                  innerChildren.Add().Text("PTO Acrual").Action("Index", "PTOAcrual");
041.                              });
042.                        
043.                    });
044.               
045.                    items.Add()
046.                        .Text("Employee")
047.                        .Items(children =>
048.                        {
049.                            children.Add().Text("Employee Search");
050.                                //.Action("Index", "Employee");
051.                            children.Add().Text("Employee Grid");
052.                                //.Action("IndexGrid", "Employee");
053. 
054.                            children.Add().Text("PTO Request")
055.                                    .Items(innerChildren =>
056.                                    {
057.                                        innerChildren.Add().Text("List").Action("Index", "PTORequest");
058.                                        innerChildren.Add().Text("New PTO Request").Action("Create", "PTORequest");
059.                                    });
060. 
061.                            children.Add().Text("Edit Personal Data").Action("Edit", "Employee", new { id = EmpId });
062.                            children.Add().Text("Employee Profile")
063.                                    .Items(innerChildren =>
064.                                    {
065.                                        innerChildren.Add().Text("List").Action("Index", "EmployeeProfile");
066.                                        //innerChildren.Add().Text("Edit my Profile").Action("Edit", "EmployeeProfile", new { id = EmpProfileId });
067.                                        innerChildren.Add().Text("Edit my Profile").Action("Edit", "EmployeeProfile");
068.                                    });
069. 
070.                            children.Add().Text("Sanction")
071.                                    .Items(innerChildren =>
072.                                    {
073.                                        innerChildren.Add().Text("List").Action("Index", "Sanction");
074.                                        innerChildren.Add().Text("New Sanction").Action("Create", "Sanction");
075.                                    });
076. 
077.                            children.Add().Text("Attendance Log")
078.                                    .Items(innerChildren =>
079.                                    {
080.                                        innerChildren.Add().Text("List").Action("Index", "AttendanceLog");
081.                                        innerChildren.Add().Text("New Attendance Log").Action("Create", "AttendanceLog");
082.                                    });
083. 
084.                            children.Add().Text("Timesheet")
085.                                    .Items(innerChildren =>
086.                                    {
087.                                        innerChildren.Add().Text("List").Action("Index", "TimeSheet");
088.                                        innerChildren.Add().Text("List (Grid)").Action("IndexGrid", "TimeSheet");
089.                                        innerChildren.Add().Text("New Timesheet").Action("Create", "Timesheet");
090.                                    });
091. 
092.                        });
093. 
094. 
095.                    items.Add()
096.                        .Text("Admin").HtmlAttributes(new { id="admin"})
097.                        .Items(children =>
098.                        {
099.                            children.Add().Text("Company").Action("Index", "Company");
100.                            children.Add().Text("Subscription Level").Action("Index", "SubscriptionLevel");
101.                            children.Add().Text("Subscription Limits").Action("Index", "SubscriptionLimit");
102.                            children.Add().Text("PTO Pool Type").Action("Index", "PTOPoolType");
103.                            children.Add().Text("Absence Code").Action("Index", "AbscenceCode");
104.                            children.Add().Text("Timesheet Status Codes").Action("Index", "TimesheetStatusCode");
105.                            children.Add().Text("Activity Log").Action("Index", "ActivityLog");
106.                            children.Add().Text("Release History").Action("Index", "ReleaseHistory");
107.                            children.Add().Text("Report List").Action("Index", "Report");
108.                            children.Add().Text("Suggestion List").Action("Index", "UserSuggestion");
109.                            children.Add().Text("Create Employee w/o User").Action("Create", "Employee");
110.                        }).Enabled(false);
111.               
112.              //items.Add().Text("About");
113.              //items.Add().Text("Contact");
114.          })
115.        )

Bill
Top achievements
Rank 1
 answered on 01 Jul 2013
4 answers
98 views
I have a grid setup with Ajax loading/editing, etc.  Paging works fine in Chrome and Firefox but in IE10 (10.0.9200.16618) I have to turn on compatibility mode to get it to work.  Without compatibility mode, paging options still show up but grid is showing all records instead of limiting to number of records set with .PageSize setting on grid. After turning on compatibility mode, the paging works but I get errors such as the attached when changing pages or opening the popup editor.

Steps to reproduce:

Paging
  1. Change page and get the first error (attachment named PagingError.png)

Editing
  1. Click the edit button in the grid.
  2. First get the same error as above
  3. Click No to debug prompt
  4. Get second error (attachment named CouldNotContinue.png)
  5. Click No to debug prompt
  6. Click edit button again
  7. Popup editor comes up but no datepicker for the date fields and date field shows "Wed Feb 13 00:00:00 CST 2013"

Any suggestions/ideas on why this is and how to correct it?
Frederick
Top achievements
Rank 1
 answered on 01 Jul 2013
2 answers
270 views
I have a grid that I toggle the visibility of certain columns on and off in certain user situations.

Hiding the columns works fine, but when I add a row to the grid, the columns I hid become visible again as soon as I click the grid's "Add" button.

I'm not sure if this is desired or not, but I'd appreciate a workaround if it's not considered a bug.  Thanks!

Script that hides the columns:
function SetItemGridView(isManual) {
    var itemGrid = $("#ItemGrid").data("kendoGrid");
 
    if (isManual) {
        itemGrid.showColumn("MyTestCol");
    } else {
        itemGrid.hideColumn("MyTestCol");
    }
}
Grid Databound function that calls SetItemGridView:
function ConfigureItemGrid(e) {
    SetItemGridView($("#IsManual").length > 0 ? $("#IsManual").is(":checked") : true);
}

Grid code (simplified for brevity):
@(Html.Kendo().Grid(Model)
    .Name("ItemGrid")
    .Columns(columns =>
    {
        columns.Bound(i => i.MyTestCol).Width(100);
        columns.Command(command =>
        {
            command.Destroy();
        }).Width(60);
    })
    .Events(e =>
    {
        e.DataBound("ConfigureItemGrid");
        e.Edit("onItemGridEdit");
    })
    .ToolBar(toolbar =>
    {
        toolbar.Create();
    })
    .Editable(editable =>
    {
        editable.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Bottom);
    })
    .Navigatable(navigatable => navigatable.Enabled(true))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .ServerOperation(false)
        .Model(model =>
        {
            model.Id(i => i.ItemModelID);
        })
        .Create(create => create.Action("CreateProducts", "ItemGrid"))
        .Read(read => read.Action("GetProducts", "ItemGrid"))
        .Update(update => update.Action("UpdateProducts", "ItemGrid"))
        .Destroy(destroy => destroy.Action("DeleteProducts", "ItemGrid"))
    )
)
Jark Monster
Top achievements
Rank 1
 answered on 01 Jul 2013
1 answer
112 views
My popup editor contains a dropdown list which fires an onchange event which populates the form with additional custom fields specific to the dropdown value. When the form is submitted, these custom fields do not show up in the FormCollection.

I am guessing the problem lies in the fact that these dynamically added fields are somehow not initialized properly?
Daniel
Telerik team
 answered on 01 Jul 2013
1 answer
239 views
Hi, 

We are using the Grid with sever binding and this works fine on our development environment with both IE8 and IE9.

However, on the corporate network the laptops must have different security settings because the Pager arrows are not displaying. 

We have tracked this down to css file refering to a domain called cloudforce.net

Turns out this file was produced by the Theme builder.

  The documentation on kendoui.com must be wrong as it says "Just copy the CSS output to a .css file and include it in your page." and has no mention of references to  cloudforce.net? 
Dimiter Madjarov
Telerik team
 answered on 01 Jul 2013
1 answer
255 views
Hi:

I am attempting to create a multi-level menu structure that is embodied in a treeview.  I have the same model at each level.  A simple example with two levels is not working.  (See below)

Controller:
public JsonResult JsonIndex()
{
 
    var menus = _db.GetMenus( 0, 1, 1, 0 );
 
    var allMenus = from m in menus
                   where m.MenuId == 1
                   select new
                       {
                           Name = m.MenuName,
                           ImageUrl = m.MenuImageUrl,
                           NavUrl = m.MenuNavUrl,
                           hasChildren = true,
                           children = from m2 in menus
                                where m2.ParentMenuId == m.MenuId
                                select new
                                {
                                   Name = m2.MenuName,
                                   ImageUrl = m2.MenuImageUrl,
                                   NavUrl = m2.MenuNavUrl,
                                   hasChildren = false,
                                }
                       };
 
 
 
 
 
    JsonResult json = Json( allMenus, JsonRequestBehavior.AllowGet );
    return ( json );
}
cshtml:

<script>
     $(document).ready(function () {
          
 
         function populateTreeView() {
             var remoteDataSource = new kendo.data.HierarchicalDataSource({
                 type: "json",
                 transport: {
                     read: "Home/JsonIndex"
                 },
                 schema: {
                     model: {
                         text: "Name",
                         ImageUrl: "ImageUrl",
                         expanded: true,
                         children: "children",
                         hasChildren: "hasChildren",
                         NavUrl: "NavUrl"
                     }
                 }
             });
              
 
             $("#tv").kendoTreeView({
                 id: "tree123",
                 Name: "tree123",
                 dataSource: remoteDataSource,
                 dataTextField: "Name",
                 dataImageUrlField: "ImageUrl",
                 select: onTreeViewSelect 
             });
         }
 
         $(document).ready(function () {
             populateTreeView();
         });
 
     });
 </script>
The actual menu is more than two levels, but I can't even get this simple case to work.  What am I doing wrong?

Thanks,

Terry
Daniel
Telerik team
 answered on 01 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?