Telerik Forums
UI for ASP.NET MVC Forum
5 answers
189 views

Hi,

I am a new user of Telerick, and i want to know if there is any way to save rowcommand button to localstorage?
i am using a grid view, and for some columns i am implementing button to download some file from the server.
Everything works well, only when i try to save the state of my grid to the local storage then when i reopen my grid all my buttons are not working any more.
Thanks in advance.

 Thanks

 Monta

Kiril Nikolov
Telerik team
 answered on 07 Jul 2015
4 answers
346 views
I have a menu that I want to add tooltips to. So far, I have added a tooltip, but it is for the entire menu and I would like different tooltips for each menu item.

Is this possible and if so, how would I do it?

Here is the code I have so far:
<div style="background-color: #41526e; float: left">
    @(Html.Kendo()
          .Menu()
          .Name("Menu")
          .Items(items =>
          {
              items.Add().Text("Home").Action("Index", "Home").ImageUrl(Url.Content("~/Images/Home.png"));
              items.Add().Separator(true);
              items.Add()
                   .Text("Search")
                   .Action("Search", "Catalog")
                   .ImageUrl(Url.Content("~/Images/Search.png"));
              items.Add().Separator(true);
              items.Add()
                   .Text("First Action")
                   .Action("FirstAction", "Catalog")
                   .ImageUrl(Url.Content("~/Images/Promote.png"));
              items.Add().Separator(true);
              items.Add()
                   .Text("Second Action")
                   .Action("SecondAction", "Catalog")
                   .ImageUrl(Url.Content("~/Images/Promote.png"));
              items.Add().Separator(true);
              items.Add()
                   .Text("Subscription Stuff")
                   .Action("Index", "Subscription");
              items.Add().Separator(true);
              items.Add()
                   .Text("Schedule Stuff")
                   .Action("CreateSchedule", "Subscription");
          })
          .Orientation(MenuOrientation.Vertical)
    )
 
    @(Html.Kendo()
        .Tooltip()
        .For("#Menu")
        //.Filter("button")
        .AutoHide(true)
        .Content("Greetings, Puny Earthling! This is a tooltip for your edification.")
        .Position(TooltipPosition.Top)
        .Width(200)
    )
 
</div>

 

TIA<

Bob

Bob
Top achievements
Rank 2
 answered on 06 Jul 2015
1 answer
169 views

Hi,

Am I going mad or are the "Mobile" demos removed from the mvc demos (http://demos.telerik.com/aspnet-mvc/)? If so, where can I find them? thanks in advance!

Best regards,

Ruud

Sebastian
Telerik team
 answered on 06 Jul 2015
2 answers
73 views
When I run the upgrade wizard to complete the version upgrade noted in the title, the wizard removes Telerik.web.UI from my references and adds a bunch of Telerik.Windows.* references instead.  I know that is part of the winforms package, but why would the upgrade wizard remove the web assemblies and add the winforms assemblies to a web application?  Is this a known issue?
Dyanko
Telerik team
 answered on 06 Jul 2015
1 answer
80 views

I have the following code:

var recurrenceEditor = $("#RecurrenceRule", form).kendoRecurrenceEditor(
     {
       frequencies: ["daily", "weekly", "monthly"]
     }
   ).data("kendoRecurrenceEditor");

 

I'm trying to convert this to typescript. Kendo.all.d.ts does not seem to recognize this.

How do I solve this?

 

thanks in advance

Georgi Krustev
Telerik team
 answered on 06 Jul 2015
2 answers
111 views
Hi, I have a checkbox column in a grid i call Active, I want it so that when someone uncheck/checks that column the record gets set inactive/active. How can I do that?
Dimiter Madjarov
Telerik team
 answered on 06 Jul 2015
8 answers
887 views
I'm trying to add a select all checkbox to the header to select/deselect all checkboxes.  The chkSelectAll checks all the checkboxes but doesn't correctly execute the checkbox handler I have below that stores the StudentID in an array.  I do not have the checkbox bound to a column, I just want to have them stored in the checked array. 

Also, my other problem is when the page is changed, the checkbox looses its state and becomes unchecked.  I would like to retain the checkbox state inbetween page selection.

KENDO GRID:
​ columns.Bound(m => m.StudentID)
.ClientTemplate("# if(StudentEmail != null) { # <input type='checkbox' class='chkbxq' name='checkedRecords' value='#= StudentID #' /> #} else {# <input type='checkbox' class='chkbxq' name='checkedRecords' value='#= StudentID #' disabled /> #} #").Title("").Width(40).HtmlAttributes(new { style = "text-align:center" }).ClientFooterTemplate("Total:")
.HeaderTemplate("<input type='checkbox' id='chkSelectAll' class='chkbxq' />").HeaderHtmlAttributes(new { style = "text-align:center" }).Sortable(false);

JAVSCRIPT:
var checked = {};

//handles select/deselect all checkboxes
​ $('#chkSelectAll').click(function() {
debugger;
$('.chkbxq:checkbox:not(:disabled)').prop('checked', this.checked);
});




​ // handle the click event of all checkboxes
$(this).delegate(":checkbox", "click", function () {
debugger;
// store the checked state of the record (this.value is set to the value of the StudentID property of the data item)
checked[this.value] = this.checked;
});
Michael
Top achievements
Rank 1
 answered on 03 Jul 2015
1 answer
1.8K+ views

Requirements:

1>I am using MVC kendo grid and I am trying to add select all/deselect check box to the header. I have javascript which does the logic of selecting & deselecting all the individual check boxes. I also want to select/deselect the header check box based on check boxes in the rows. Since during grid initialization grid rows are unknown, we cannot attach click event to the individual check boxes in the rows. we have to do that after data is bound to the grid.

2> I also wanted to maintain the state of the check boxes when user navigate through pages or do sorting. ( because of this paging & sorting is done on client side. Server operation is set to false) The javascript is working correctly.

Issues:

1> I’m calling this javascript in dataBound event of the grid as suggested here by telerik support. However dataBound event is getting fired on each page change and sort. As per the documentation here it should get fired when widget is bound to dataSource. So I tried dataSource’s requestEnd event, but requestEnd event is also getting fired on each page change & sort. AGAIN, as per the documentation here it should only get fire when remote service request is finished.

2>I also noticed, when I view the page source in browser the grid has rows only for that particular page. So my javascript only finds check boxes for that page only.

So how do I implement select all check box column that will select all the check boxes and also maintain the states across paging and sorting? can someone please show some examples

$(function () {
 
 
    $gridElement = $("#grid");
    var kendoGrid = $gridElement.data("kendoGrid");
    var dataSource = kendoGrid.dataSource;
     
    kendoGrid.bind("dataBound", function (e)
        {
            configureSelectCheckBoxes($gridElement)
        }
    )
 
    $("#btnSearch").click(function () {
        kendoGrid.dataSource.read();
        kendoGrid.refresh();
        kendoGrid.dataSource.page(1);
    })
 
     
    function configureSelectCheckBoxes(grid) {
        // attach click event to select all check box
        grid.find("thead input:checkbox").click(
            function () {
                grid.find("td input:checkbox").prop("checked", $(this).prop("checked"));
            }
         );
 
        // attach click event to individual check box
        grid.find("tbody input:checkbox").click(
               function () {
                   var checkedCount = grid.find("td input:checkbox:checked").length;
                   var totalCount = grid.find("td input:checkbox").length;
                   grid.find("th input:checkbox").prop("checked", checkedCount === totalCount);
               }
        );
    }
})

 

@(Html.Kendo().Grid<MVCPOC.Models.MyModel>()
            .Name("grid")
            .Columns(col =>
            {
                col.Bound(p => p.ModelID)
                    .ClientTemplate("<input class='chkbox' type='checkbox' value='#=ModelID#' />")
                    .HeaderTemplate("<input type='checkbox' id='selectAll' />")
                    .Width(30)
                    .Sortable(false)
                    .Filterable(false);               
                col.Bound(p => p.StateProvinceCode);               
                col.Bound(p => p.EmailAddress);
            })
            .AutoBind(false)
            .Pageable()
            .Sortable()
            .Scrollable(x => x.Height(300))
            .HtmlAttributes(new { style = "height:500px" })
            .DataSource(dataSource => dataSource
                .Ajax()
                .ServerOperation(false)
                .PageSize(20)
                .Read(read => read
                    .Action("GetData", "Grid")))
 
        )

 

 

 

Hristo Valyavicharski
Telerik team
 answered on 03 Jul 2015
2 answers
234 views

Hello All,

         I am just trying to see the code in the Kendo examples for diagram implementation that I have downloaded recently (Latest release telerik.ui.for.aspnetmvc.2015.2.624.commercial), But when I run the solution locally and browse the 'Editing' section of the diagram I do get the shapes and connections as in demo site but I am not able to add a new shape (or new rectangle) to the diagram. When I press the rectangle icon in tool bar I get a error in browser console as follows.

Chrome: kendo.all.min.js:68 Uncaught TypeError: Cannot read property 'gradient' of undefined)

FireFox: kendo.all.min.js:68:8298 TypeError: t is undefined

 Also other options in the tool bar are also not working.

 

Ron
Top achievements
Rank 2
 answered on 03 Jul 2015
3 answers
288 views

Hi,

 

I've a MVC ListView which was working perfectly until I've localized it to German. My resources are managed in Visual Studio's Resource Designer, the typical way I'd say. If any of these resources contains an umlaut and is used directly in the template, it will be converted to something like "&#246;". The unescaped hash sign breaks the template. I've tried several attempts to fix this issue, but none of them worked:

1.<script type="text/x-kendo-tmpl" id="recordLinesTemplate">
2.@Resources.Resources.BtnDeleteLine // "Zeile l&#246;schen"
3.@Resources.Resources.BtnDeleteLine.Replace('#', 'X') // "Zeile l&#246;schen"
4.@((Resources.Resources.BtnDeleteLine).Replace('#', 'X')) // "Zeile l&#246;schen"
5.@Resources.Resources.BtnDeleteLine.Replace("ö", "ö") // "Zeile l&amp;ouml;schen"
6.@WebUtility.HtmlEncode(Resources.Resources.BtnDeleteLine) // "Zeile l&amp;#246;schen"
7.</script>

Out of curiosity, I've tried to encode the umlaut directly in the resource, but the ampersand gets encoded as well.

Any ideas how to resolve this issue?

Beste Grüße with two umlauts,

   Carsten

dbCF
Top achievements
Rank 2
 answered on 03 Jul 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?