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

HI Team,

 

I have downloaded the new version of Kendo Dll with version 2016.2.714  after that kendo dropdown list not working as expected

when I click first time noting is showing just flickering second  time  click it is opening the values  .need to click first time any where in the form then if we click dropdown it will open.

  if my  cshtml page contain multiple dropdown list for first dropdown list only we are facing the issue

Please find the attached sample code could you please help me out to resolve the issue.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Nencho
Telerik team
 answered on 28 Jul 2016
1 answer
111 views
Hello I'm trying to load a load-on-demand treeview on document.ready and trigger the select event of a child node according to a path like shows this jsbin:
http://jsbin.com/ESOjAmi/8/edit?html,css,output
The problem in my case is that exist child nodes that have the same id as parents, because are two different entities, so in those cases the parent is expanded but the children that I want to select and trigger the select event is not selected. I guess because the method get in the datasource returns the first node that match the id.
The problem is in this part of the code in the jsbin example because in the case of the path [1,1] for example it expands the parent node but not the children with id 1 and i want to trigger the select event of the children node. In the other cases for example with path [1,2] the treeview is expanded and the select event of the child node with id = 2 is triggered correctly
 else {
        // otherwise select
        node = treeview.findByUid(ds.get(path[0]).uid);
        treeview.select(node);
        treeview.trigger("select", { node: node });
      }
Maybe someone can modify the JSbin example to reflect my case please?
Thank you
Peter Milchev
Telerik team
 answered on 27 Jul 2016
1 answer
86 views

Hello I'm trying to load a load on demand tree on document.ready according to a path like shows this jsbin:

http://jsbin.com/ESOjAmi/8/edit?html,css,output

The problem in my case is that exist child nodes that have the same id as parents, because are two different entities, so in those cases the parent is expanded but the children that i want to select and trigger the select event is not selected i guess because the method get in the datasource returns the first node that match the id.

The problem is in this part of the code because in the case of the path [1,1] for example it expands the parent node but not the children with id 1 and i want to trigger the select event of the children node.

 else {
        // otherwise select
        node = treeview.findByUid(ds.get(path[0]).uid);
        treeview.select(node);
        treeview.trigger("select", { node: node });
      }

Maybe you can modify the example to reflect my case please?

Thank you

Ivan Danchev
Telerik team
 answered on 27 Jul 2016
4 answers
237 views

I found following problem:

I have one main view MainView with two different partial views ViewOne and ViewTwo returned to the main view by separate @HTML.RenderAction(Action, controller) methods from different controllers . The partial views renders Ajax form with model fields in the first view and  KendoDataGrid in the second partial view.Both views uses different data models but  one field in each model has the same name. eg ForeignKey_ID.

When I try to edit a row in the second view (data grid) the row goes to edit state but instead of a dropdown with names/labels for ForeignKey_ID a text box with default id numerical value appears. In the same time missing dropdown shows up just by the dropdown for  ForeignKey_ID field in the first partial view (Ajax form)

I tried to use different field in the second view (datagrid) so there was no the same field name in the whole page and then expected dropdown with dictionary values shown up properly.

It can be solved by changing affected field name in the model.

Is there any other solution for this ?

 

 

ForeignKey_ID
Konstantin Dikov
Telerik team
 answered on 27 Jul 2016
4 answers
1.3K+ views

I have a grid, I want to fire the event edit like I'm clicking the edit button to fire the popup edit template, but without clicking it with the mouse but programatically. I this posible?

I tried trigger it on the databound event like this:

 

for (var i = 0; i < rows.length; i++) {

if(Myid == theIdOntheRow)

{

 $(rows[i]).addClass('k-state-selected');
                        var btnEdit = $(rows[i]).find(".k-grid-edit");                        
                        btnEdit.trigger('click');

 

...

 

I hope there are a clenear way to do this. Thanks

Dimiter Madjarov
Telerik team
 answered on 27 Jul 2016
1 answer
64 views

So, I've been spending roughly a day extra coding javascript and testing my code only to find that the date in data-value of the td elements are one month behind.

I'm posting a screenshot. now my question is, is this considered a bug? it's not hard for me to compensate for this, but I'd hate to change it again after a brief bug fix patch. please get back to me on this.

Viktor Tachev
Telerik team
 answered on 27 Jul 2016
2 answers
212 views

public class FavoritesController : Controller
    {
        public IActionResult Favorites_Read([DataSourceRequest] DataSourceRequest request)
        {
            ...

            return Json(listings.ToDataSourceResult(request));
        }
    }

 

@(Html.Kendo().ListView<ListingDetails>()
    .Name("listView")
    .TagName("div")
    .ClientTemplateId("listingTemplate")
    .Pageable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(5)
        .Model(model => model.Id(p => p.ID))
        .Create(update => update.Action("Favorites_Create", "Favorites"))
        .Read(read => read.Action("Favorites_Read", "Favorites"))
        .Update(update => update.Action("Favorites_Update", "Favorites"))
        .Destroy(update => update.Action("Favorites_Delete", "Favorites"))
    )
    .Deferred()
    )

 

I've set a breakpoint at the beginning of Favorites_Read, but the action is not being hit. Any help would be greatly appreciated.

Konstantin Dikov
Telerik team
 answered on 27 Jul 2016
5 answers
382 views

Hello I have some trouble with a grid, when i try to add a Template in order to generate a personalizated Pdf file.

I wrote many times the example is shown by Telerik, but I only get a grid without  the template.

I can´t see the pagination #pages nr etc.

My code is:

<style>
    /*
        Use the DejaVu Sans font for display and embedding in the PDF file.
        The standard PDF fonts have no support for Unicode characters.
    */
    .k-grid {
        font-family: "DejaVu Sans", "Arial", sans-serif;
        width: 750px;
        height: 350px;
    }

    /* Hide the Grid header and pager during export */

    .k-pdf-export .k-grid-toolbar,
    .k-pdf-export .k-pager-wrap {
        display: none;
    }
</style>


<!-- Load Pako ZLIB library to enable PDF compression -->
<script src="~/Scripts/pako.min.js"></script>


<script type="x/kendo-template" id="page-template">
    <div class="page-template">
        <div class="header">
            <div style="float: right">Page #: pageNum # of #: totalPages #</div>
            Multi-page grid with automatic page breaking
        </div>
        <div class="watermark">KENDO UI</div>
        <div class="footer">
            Page #: pageNum # of #: totalPages #
        </div>
    </div>
</script>

<div class="box wide">
    <p style="margin-bottom: 1em"><b>Important:</b></p>

    <p style="margin-bottom: 1em">
        This page loads
        <a href="https://github.com/nodeca/pako">pako zlib library</a> (pako_deflate.min.js)
        to enable compression in the PDF. This is highly recommended as it improves
        performance and rises the limit on the size of the content that can be exported.
    </p>

    <p>
        The Standard PDF fonts do not include Unicode support.

        In order for the output to match what you see in the browser
        you must provide source files for TrueType fonts for embedding.

        Please read the documentation about
        <a href="http://docs.telerik.com/kendo-ui/framework/drawing/drawing-dom#custom-fonts-and-pdf">custom fonts</a>
        and
        <a href="http://docs.telerik.com/kendo-ui/framework/drawing/pdf-output#using-custom-fonts">drawing</a>.
    </p>
</div>

@(Html.Kendo().Grid<Bams.Models.ListePdf>()
        .Name("grid")
        .ToolBar(tools => tools.Pdf())
        .Pdf(pdf => pdf
            .AllPages()
            .AvoidLinks()
            .PaperSize("A4")
            .Scale(0.8)
            .Margin("2cm", "1cm", "1cm", "1cm")
            .Landscape()
            .RepeatHeaders()
            .TemplateId("page-template")
            .FileName("Kendo UI Grid Export.pdf")
            .ProxyURL(Url.Action("Pdf_Export_Save", "Test"))
        )
        .Columns(columns =>
        {
            columns.Bound(c => c.Id)
              .Width(20).Title("Nr");
            columns.Bound(c => c.Name).Width(50).Title("Name");
            columns.Bound(c => c.Beschreibung).Width(50).Title("Beschr.");
            columns.Bound(c => c.Hersteller).Width(30).Title("Herst.");
            columns.Bound(c => c.Alias).Width(30).Title("Alias");
            columns.Bound(c => c.Datums).Width(20).Title("Datum");
        })
        .HtmlAttributes(new { style = "height: 550px;" })
        .Scrollable()
        //.Groupable()
        .Sortable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("getListe", "Test"))
            .PageSize(2)
        )
)
<style>
    /* Page Template for the exported PDF */
    .page-template {
        font-family: "DejaVu Sans", "Arial", sans-serif;
        position: absolute;
        left: 20px;
        right: 20px;
        font-size: 40%;
    }

        .page-template .header {
            top: 10px;
            border-bottom: 1px solid #000;
        }

        .page-template .footer {
            bottom: 10px;
            border-top: 1px solid #000;
        }
</style>

 

What is Wrong?????

Frank
Top achievements
Rank 1
 answered on 27 Jul 2016
1 answer
266 views

Hi

 

I am using databinding in my MVC view with ComboBoxFor (see sample below).

This works great when I am using this the first time (new record). However, when I want to Edit my entity, I want that upon opening the view, the ProductName is already there. How to accomplish this? If I set the .Text property then this is showed, but the binding gets lost when I save. Is there a way set force a call to the controller to get the ProductName based upon the bound MyProductId?

 

@(Html.Kendo().ComboBoxFor(m => m.MyProductID)
          .Placeholder("Select product")
          .DataTextField("ProductName")
          .DataValueField("ProductID")
          .HtmlAttributes(new { style = "width:100%;" })
          .Filter("contains")
          .AutoBind(false)
          .MinLength(3)
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("GetProducts", "Home");
              })
              .ServerFiltering(true);
          })
    )

Danail Vasilev
Telerik team
 answered on 27 Jul 2016
4 answers
215 views

Hi, I'm new here.

 

I'm developing a site which uses the Calendar, one requirement is that I need to be able to color the days of the month depending on the model state.

 

I've seen a couple of examples that has the Calendar declared in javascript, I'm working with Razor, in a .cshtml file. I can freely access a property in the model to return a CssClass string.

my calendar is written like this.

@(Html.Kendo().Calendar()
                  .Name("Trafikkalender")
                  .Culture("sv-SE")
                  .HtmlAttributes(new {style = "width: 100%;"})
                  .Events(e => e.Change("DateClick").Navigate("Navigate"))
                  .Format("dd MM yyyy")
                  
                  )

I know I need the .MonthTemplate("") property for my purpose, but I don't know what the syntax is for the string. the Model object returns a custom date object with a DateTime as input, how would I accomplish my goal? the examples and demos I've found here are very poorly commented/explained, I need more information.

Viktor Tachev
Telerik team
 answered on 27 Jul 2016
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?