Telerik Forums
UI for ASP.NET MVC Forum
1 answer
412 views

The following dropdownlist works fine:

 

    @(Html.Kendo().DropDownList()
            .Name("TrunkDepotsList")
            .HtmlAttributes(new { style = "width: 70px;" })
            .DataTextField("DepotNumber")
            .DataValueField("DepotID")
            .BindTo(Model.DepotList)
            .SelectedIndex(Model.DepotIndex)
    )

 

However - when I add an event handler, it turns into a textbox:

 

    @(Html.Kendo().DropDownList()
            .Name("TrunkDepotsList")
            .HtmlAttributes(new { style = "width: 70px;" })
            .DataTextField("DepotNumber")
            .DataValueField("DepotID")
            .BindTo(Model.DepotList)
            .SelectedIndex(Model.DepotIndex)
            .Events(e =>
            {
                e.Change("refreshTrunkSummaryPage");
            })
    )

 

For reference, here's my event handler script:

 

function refreshTrunkSummaryPage() {
        alert('refresh running');

        ...etc

}

Nencho
Telerik team
 answered on 28 Mar 2017
2 answers
88 views

http://demos.telerik.com/aspnet-mvc/combobox/serverfiltering

The view and the controller do not seem to work together.  The view is calling a controller action that does not exist, the controller action that does exist is not returning any data.

Or if I'm wrong, I'll humbly accept corrections :-)

Duke
Top achievements
Rank 1
 answered on 27 Mar 2017
1 answer
562 views

I'm trying to use the Telerik MVC TreeView control with the kendo.data.HierarchicalDataSource control and local data.

In samples for the Kendo Treeview, they point to the Javascript datasource like this:

dataSource: homogeneous

What syntax do I use in the fluent MVC TreeView to reference data that's held in a JavaScript variable?

Showing my hierarchical data below.

Thanks,

Ken

   "bodyType":"ESTATE",
   "capCode":"VWTI20SE5EDTM4",
   "capID":null,
   "co2Emissions":"167",
   "colour":"SILVER",
   "cylinderCapacity":"1968 cc",
   "dateFirstUsed":"23 July 2009",
   "dateOfFirstRegistration":"23 JULY 2009",
   "description":"2009 Volkswagen Tiguan Se Tdi (140) 4MOTION, 1968CC Diesel, 5DR, Manual",
   "engineSize":"1968CC",
   "fuel":"Diesel",
   "fuelType":"DIESEL",
   "imported":"false",
   "insuranceGroup":"09",
   "licencePlate":"mt09nks",
   "make":"Volkswagen",
   "model":"Tiguan",
   "mot":true,
   "motDetails":"Expires: 28 April 2017",
   "motTestReports":[ 
      { 
         "motTestNumber":244794981138,
         "testResult":"Pass",
         "testDate":"29 April 2016",
         "odometerReading":80084,
         "expiryDate":"28 April 2017",
         "advisoryItems":[ 
 
         ],
         "failureItems":[ 
 
         ]
      },
      { 
         "motTestNumber":938552815158,
         "testResult":"Pass",
         "testDate":"22 April 2015",
         "odometerReading":74998,
         "expiryDate":"21 April 2016",
         "advisoryItems":[ 
 
         ],
         "failureItems":[ 
 
         ]
      },
      { 
         "motTestNumber":157384685012,
         "testResult":"Fail",
         "testDate":"25 March 2015",
         "odometerReading":74813,
         "expiryDate":"",
         "advisoryItems":[ 
            "Front Brake pad(s) wearing thin (3.5.1g)",
            "Front brake disc worn, pitted or scored, but not seriously weakened (3.5.1i)",
            "Rear brake disc worn, pitted or scored, but not seriously weakened (3.5.1i)",
            "Rear Brake pad(s) wearing thin (3.5.1g)",
            "Nearside Front Suspension arm rubber bush deteriorated but not resulting in excessive movement (2.4.G.2)",
            "Offside Front Suspension arm rubber bush deteriorated but not resulting in excessive movement (2.4.G.2)"
         ],
         "failureItems":[ 
            "Nearside Front Tyre tread depth below requirements of 1.6mm (4.1.E.1)",
            "Offside Front Tyre tread depth below requirements of 1.6mm (4.1.E.1)",
            "Front Brakes imbalanced across an axle (3.7.B.5b)",
            "Nearside Front Windscreen wiper does not clear the windscreen effectively (8.2.2)"
         ]
      },
      { 
         "motTestNumber":195455474181,
         "testResult":"Pass",
         "testDate":"24 June 2014",
         "odometerReading":63643,
         "expiryDate":"23 July 2015",
         "advisoryItems":[ 
 
         ],
         "failureItems":[ 
 
         ]
      },
      { 
         "motTestNumber":198414503254,
         "testResult":"Pass",
         "testDate":"23 July 2013",
         "odometerReading":52191,
         "expiryDate":"23 July 2014",
         "advisoryItems":[ 
 
         ],
         "failureItems":[ 
 
         ]
      },
      { 
         "motTestNumber":945398182180,
         "testResult":"Pass",
         "testDate":"6 July 2012",
         "odometerReading":308600,
         "expiryDate":"23 July 2013",
         "advisoryItems":[ 
 
         ],
         "failureItems":[ 
 
         ]
      }
   ],
   "numberOfDoors":"5",
   "numberOfSeats":"5",
   "price":"6465.0",
   "steering":"RHD",
   "transmission":"MANUAL",
   "typeApproval":"M1",
   "vin":"WVGZZZ5NZAW007903",
   "year":"2009",
   "yearOfManufacture":"2009"
}
Nencho
Telerik team
 answered on 27 Mar 2017
1 answer
141 views

I have tabstrip that is displaying a partial from a different controller/view area, but I cant get the post of the partial in the tabstrip to post back to the different controller

 

the View that the tab is in.

~/Areas/Secure/Views/Company/companyStaff.cshtml

display a view assocated to a different controller

tabstrip.Add().Text("Create Contact")
                  .Selected(false)
                  .Content(Html.Partial("~/Areas/Secure/Views/Contact/_ContactManagement.cshtml",  new WebSite.Library.Models.Contact() , new ViewDataDictionary { { "Id", "0" } }).ToHtmlString());

 

How can I get the partial in the tab to post back to its own controller post method

Ivan Danchev
Telerik team
 answered on 27 Mar 2017
4 answers
819 views

Hi,

I am using the Pdf export to print a grid. In the page header on each page I would like to have content from the model (or the ViewBag or some other way), in any case data that I can set in the method in the controller when I load the ViewModel for the page. I have found a lot of info about the page headers, but the page number is the only variable data I have seen.

I would like to show something like "Inventory as of Dec 3rd, report printed March 21st", so not only page number and today's date but other stuff too.

Is this possible and if so, can someone please point me in the right direction for info on this?

 

Best regards,

Henrik

Henrik
Top achievements
Rank 1
 answered on 27 Mar 2017
1 answer
1.2K+ views

How do i get the value of a Kendo Date Picker by class name. The reason being is because im using the name and id attributes for something else. As you can see below the class attribute is dynamic. Every other time ive selected a Kendo Date Picker, i've always used the ID attribute. Is it possible to select by class attribute?

@Html.Kendo().DatePicker()
              .Name("SurveyResponse.DateRes[" + @guid + "].Date")
              .Format("MM/dd/yyyy")
              .HtmlAttributes(new {
                       onkeydown = "javascript:return false;",
                       onblur = "ConditionalTextBox(" + @item.SurveyQuestionID + ",'datecontrol')",
                       @placeholder = "Your answer",
                       @required = "required",
                       @class = "IsConditionalTextBox_" + @item.SurveyQuestionID
                       })
Konstantin Dikov
Telerik team
 answered on 24 Mar 2017
1 answer
140 views

Greetings all,

 

I am attempting to have the same select list display on one page via MVC Display Templates. So far I've only been able to get one of the select lists to display at a time. Is this functionality not allowed. See my code example below:

 

    <div class="row">
        <div class="">@Html.DisplayFor(m => m.AgentSelector)</div>
    </div>
 
<div class="">
<p> a bunch of misc. data is here </p>
</div>
 
    <div class="row">
        <div class="">@Html.DisplayFor(m => m.AgentSelector)</div>
    </div>

 

The first one works. The second one does not. Is there a way to get this to work.

Ianko
Telerik team
 answered on 24 Mar 2017
1 answer
60 views
Hello~ I would like to make kendo window to show kendo grid cell detail. Actually, I worked fine, but kendo window show original value not foreign key as I set in kendo grid column. Is that possible to show foreign key value in kendo window instead of original value? thanks in advance~
Nikolay
Telerik team
 answered on 24 Mar 2017
1 answer
110 views

Hello,

I have used kendo scheduler for displaying schedule but not able see any event on scheduler and also not getting error as well.

please check attached images for reference. 

Thanks,

Vinal Patwa

 

Nencho
Telerik team
 answered on 24 Mar 2017
6 answers
3.4K+ views
Hi!

Is there any way to add dynamic default values? When I push the "Add row" button a new row with a new default value (max  value + 1) for count column should be added.

Example:

.ToolBar(toolbar => {
        toolbar.Create().Text("Add row");
    })
...
 .Model(model => {
            model.Id(n => n.ID);
            model.Field(c => c.count).DefaultValue(<this value needs to be max value + 1>);
            model.Field(c => c.count).Editable(false);
        })

I have tried to adding an event on .Events( e => e.Change("MyFunction"))  but the row adding is done after MyFunction event is fired.

/Malte

Randy
Top achievements
Rank 1
 answered on 24 Mar 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?