Telerik Forums
UI for ASP.NET MVC Forum
7 answers
116 views

when using  

<script src="~/Scripts/kendo/kendo.all.min.js" type="text/javascript"></script>
    <script src="~/Scripts/kendo/kendo.aspnetmvc.min.js" type="text/javascript"></script>

we get the below mentioned exception: 

 Illegal characters in path.
  ~/Content/kendo/fonts/DejaVu/DejaVuSans-Bold.ttf) format("truetype"

System.ArgumentException was unhandled by user code
  HResult=-2147024809
  Message=Illegal characters in path.
  Source=mscorlib
  StackTrace:
       at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
       at System.IO.Path.Combine(String path1, String path2)
       at System.Web.Configuration.UserMapPath.GetPhysicalPathForPath(String path, VirtualDirectoryMapping mapping)
       at System.Web.Configuration.UserMapPath.GetPathConfigFilename(String siteID, VirtualPath path, String& directory, String& baseName)
       at System.Web.Configuration.UserMapPath.MapPath(String siteID, String path)
       at System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull)
       at System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull)
       at System.Web.CachedPathData.GetPhysicalPath(VirtualPath virtualPath)
       at System.Web.CachedPathData.GetConfigPathData(String configPath)
       at System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp)
       at System.Web.HttpContext.GetFilePathData()
       at System.Web.HttpContext.GetConfigurationPathData()
       at System.Web.Configuration.RuntimeConfig.GetConfig(HttpContext context)
       at System.Web.Configuration.HttpCapabilitiesBase.GetBrowserCapabilities(HttpRequest request)
       at System.Web.HttpRequest.get_Browser()
       at System.Web.HttpResponse.ApplyRedirectQueryStringIfRequired(String url)
       at System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
       at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
       at FastStart.Web.Global.Application_Error(Object sender, EventArgs e) in C:\svn\newrxrequest\FastStart\Refactor\branches\20151018\FastStart.Web\Global.asax.cs:line 105
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Web.HttpApplication.RaiseOnError()
  InnerException: 

Dimo
Telerik team
 answered on 30 Sep 2015
5 answers
383 views
I have a kendo upload control that gets posted with a form that has a variety of other fields.  This works great when the user fills everything out correctly, the problem comes when there is an error with the post that causes ModelState.IsValid to be false.  Normally I would repopulate the model and the form would have all of the entered values.

I cannot find a way to populate the kendo upload control so the old HttpPostedFileBase gets reposted on the next form post.  Is this possible?


Thanks,
Logan
Dimiter Madjarov
Telerik team
 answered on 30 Sep 2015
1 answer
146 views

 I am getting the following error when I am pressing the Edit button for the ListView. I am not sure why. The Data from the model appears and I can edit the input fields but it does not call the Update method on the controller.

 

Uncaught SyntaxError: Unexpected identifier
vt.getter @ kendo.all.min.js:9
ut.extend.get @ kendo.all.min.js:11
S.extend.get @ kendo.all.min.js:12
E.widget.value.v.extend.init @ kendo.all.min.js:12
b.extend.applyBinding @ kendo.all.min.js:13
I.extend.bind @ kendo.all.min.js:13
a @ kendo.all.min.js:12
a @ kendo.all.min.js:12
a @ kendo.all.min.js:12
a @ kendo.all.min.js:12
a @ kendo.all.min.js:12
s @ kendo.all.min.js:12
c.extend.refresh @ kendo.all.min.js:26
c.extend.init @ kendo.all.min.js:26
(anonymous function) @ kendo.all.min.js:10
b.extend.each @ jquery.min.js:3
b.fn.b.each @ jquery.min.js:3
vt.plugin.e.fn.(anonymous function) @ kendo.all.min.js:10
n.ui.DataBoundWidget.extend.edit @ kendo.all.min.js:33
(anonymous function) @ kendo.all.min.js:33
b.event.dispatch @ jquery.min.js:3
b.event.add.v.handle @ jquery.min.js:3

 

MVC Code for the ListView

@(Html.Kendo().ListView<RPMS.Models.ActualsHoursViewModel>(Model)
    .Name("ListView")
    .TagName("div")
    .ClientTemplateId("ActualsHoursTemplate")
     
    .DataSource(dataSource => dataSource
        .Model(model =>
            {
            model.Id(m=>m.ActualsHoursModelsId);
            model.Field(m => m.ProjectId);
            model.Field(m => m.HoursAllocated);
            model.Field(m => m.Activities);
            }
        )
        .ServerOperation(true)
        .Batch(true)
        .Create(create => create.Action("kendo_Create", "ActualsHours"))
        .Read(read => read.Action("kendo_Read", "ActualsHours", new { date = "" }))
        .Update(update => update.Action("kendo_Update", "ActualsHours"))
        .Destroy(destroy => destroy.Action("kendo_Destroy", "ActualsHours"))
        .Events(events => events.Error("error_handler"))
         
    )
    .Editable()
    .Events(ev => {
        ev.DataBound("initDropDownLists");
        }
    )
    .Selectable()
           // .Events(events => events.Error("error_handler"))
 
)
 

 

 

Daniel
Telerik team
 answered on 30 Sep 2015
3 answers
127 views

Correct data is returned from the server, and it seems to be paging correctly, but I get a big empty dropdown list. What am I doing wrong? As far as I can tell, this code matches the code from the demo. Using v.2015.2.805.545.

Controller:

public ActionResult GetCustomers([DataSourceRequest] DataSourceRequest request) {
    var customers = Context.Customers.Where(c => c.DateDeleted == null);
 
    var results = customers.ToDataSourceResult(request, ModelState, c => new CustomerSelectListItem(c));
  
    return Json(results, JsonRequestBehavior.AllowGet);
}
 
public ActionResult CustomersValueMapper(int[] values) {
    //this method exists to get a concrete "row number" for the value(s) in question.
    //
    //to fulfill this requirement, we're using List's FindIndex method over a collection of all customers stored in the Session
    //
 
    var indices = new List<int>();
 
    var customers = GetAllCustomers();
 
    if (values != null) {
        //add all customers with indices >= 0
        indices.AddRange(values.Select(value => customers.FindIndex(c => c.Id == value))
            .Where(index => index >= 0));
    }
     
    return Json(indices, JsonRequestBehavior.AllowGet);
}
 
private List<Customer> GetAllCustomers() {
    if (Session["allCustomers"] == null) {
        Session["allCustomers"] = Context.Customers.Where(e => e.DateDeleted == null).ToList();
    }
 
    return (List<Customer>)Session["allCustomers"];
}

 

Javascript:

 

function valueMapper(options) {
    console.log("valueMapper: options.value = " + options.value);
    $.ajax({
        url: "@Url.Action("CustomersValueMapper", "Equipment", new {area="Dispatch"})",
        data: convertValues(options.value),
        success: function (data) {
            options.success(data);
    }
});
}
 
function convertValues(value) {           
    var data = {};
 
    value = $.isArray(value) ? value : [value];
 
    for (var idx = 0; idx < value.length; idx++) {
        data["values[" + idx + "]"] = value[idx];
    }
 
    return data;
}

 

 View:

@(Html.Kendo().DropDownList()
    .Name("customerId")
    .DataValueField("Value")
    .DataTextField("Text")
    .DataSource(ds => ds.Custom()
        .ServerPaging(true)
        .PageSize(80)
        .Type("aspnetmvc-ajax") //uses DataSourceRequest
        .Transport(transport => transport.Read("GetCustomers", "Equipment", new { area = "Dispatch" }))
        .Schema(schema => schema
            .Data("Data")
            .Total("Total"))
    ).Virtual(v => v.ItemHeight(26).ValueMapper("valueMapper"))
)
Scott
Top achievements
Rank 1
 answered on 29 Sep 2015
2 answers
290 views

Hello everyone.

I am doing a proof of concept with telerik mvc grid controls and am in the following situation.

1. Using the Kendo Grid i am trying to do the following..

a Popup Edit screen with a Custom template with a dropdown list that calls the controller for additional info.

Here is the code i have so far 

 

    columns.ForeignKey(p => p.CASH_ISIN_CHR, (System.Collections.IEnumerable)ViewData["cashisnnames"], "ISIN_CHR", "Name_CHR").Title("CASH ISIN").EditorTemplateName("CashISINEditor");
    columns.ForeignKey(p => p.CURRENCY_ISIN_CHR, (System.Collections.IEnumerable)ViewData["currencyisnnames"], "ISIN_CHR", "Name_CHR").Title("CURRENCY ISIN").EditorTemplateName("CurrencyISINEditor");
    columns.Bound(c => c.Units_INT).Title("UNITS");
    columns.Bound(c => c.Local_Amount_DEC).Title("Local Amt");
    columns.Bound(c => c.Trade_DATE).Format("{0:d}").Title("Trade Date");
    columns.Bound(c => c.Settlement_DATE).Format("{0:d}").Title("Settle Date");
    columns.Bound(c => c.Custodian_Reference_Num_CHR).Title("Cust. Ref #");
    columns.Bound(c => c.Entered_DNT).Format("{0:d}").Title("Entered Date");
    columns.Bound(c => c.FX_Rate_DEC).Title("FX Rate");
    columns.Command(command => { command.Edit(); }).Width(180);
})
.ClientDetailTemplateId("template")
.ToolBar(toolbar =>
{
    toolbar.Excel();
    toolbar.Pdf();
})
.Excel(excel => excel.FileName("Transaction Master Export.xlsx").AllPages(true)
)
.Pdf(pdf => pdf.AllPages())
.ColumnMenu()
.HtmlAttributes(new { style = "height:750px;" })
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("CustomTransactionMasterEditor"))
.Pageable()

I have an editor template called CustomTransactionMasterEditor and the code in it looks like this:

@model BetaSMTRApp.Models.Transaction_Master
 
<h3>Custom Transaction Master</h3>
 
@Html.TextBoxFor(model => model.FUND_INT).ToString()
@Html.TextBoxFor(model => model.TYPE_CHR)
 
 
@(Html.Kendo().DropDownListFor(m => m)
        .Name("cashisndd")
        .DataValueField("ISIN_CHR")
        .DataTextField("Value")
         
        .DataSource(ds => ds
                 
                .Read(read => read.Action("GetCASHISIN", "TransactionMaster", new { FundInt = 223, TypeChr = "Expense" })
                ))

In the TextBoxFor fields i am getting fund int and type chr... both of which i need to pass in the .Read on the data source line.  When i try to use Model it is null.

 How can i get the textbox for value into the new section of the .Read?

 

Thanks,

 

Corey

Paul
Top achievements
Rank 1
 answered on 29 Sep 2015
2 answers
58 views
I am looking for an example that loads a treeview from data that is not self-referencing (no ParentID field) but with specific category levels.  If my data looks like:
ID   Lastname     Firstname  City       State
1     Davolio         Nancy          Seattle   WA
2     Fuller            Andrew        Tacoma  WA
3     Washington George          Dallas     TX
4     Leverling      Janet            Kirkland  WA
5     Peacock       Margaret      Seattle    WA
6     Doe              Jane             Austin     TX
7     Doe              John             Dallas     TX

… I want it to come out like this:
TX
 â”” Austin
          â”” Jane Doe
â”” Dallas
          â”” George Washington
          â”” John Doe
WA
  â”” Kirkland
            â”” Janet Leverling
  â”” Seattle
            â”” Nancy Davolio
            â”” Margaret Peacock
   â”” Tacoma
            â”” Andrew Fuller


I also would like it to load on demand (JsonResult) as each state and city gets expanded.
Is there an example on how to build the tree like this?
Boyan Dimitrov
Telerik team
 answered on 29 Sep 2015
1 answer
105 views

Hi, 

Here's a question what event or function is called when the user presses the cancel or close button on the mvc grid popup editor. 

 

Best, 

A. Guzmán 

Boyan Dimitrov
Telerik team
 answered on 29 Sep 2015
2 answers
149 views

Hello,

selecting a DropDownList inside of a window-control results in a scrollbar on the side of the window-control. How can I prevent that?

I attached a screenshot so you can see what I am talking about.

Thanks in advance.

Oliver
Top achievements
Rank 1
 answered on 29 Sep 2015
1 answer
232 views

Assuming I have the below table:

@Html.Kendo().Grid(Model).Name("Staff").Columns(x =>{         x.Bound(y => y.StaffId);         x.Bound(y => y.FirstName);         x.Bound(y => y.LastName);         x.Bound(y => y.Email);         x.Bound(y => y.Phone);         x.Command(y => y.Custom("Edit").Action("edit", "controller", new { id = ????? }));}).Sortable().Scrollable().Pageable(x=> x.PageSizes(true)).Filterable()

 

How can I pass the primary key value (StaffId in this case) associated to the row to the object route values similar to the way it is done by Visual Studio auto-scaffold? I do not want a Java Script based solution. I am just looking for a way to pass the current row id (PK) to server action. Is it possible?

For more information please refer this SO thread.

Boyan Dimitrov
Telerik team
 answered on 29 Sep 2015
1 answer
262 views
Hello,
 I want to change combobox width but I have problem with ​styling. I attached screen capture, I tried two way for set combo width but not working well. I using bootstrap in my project. How can I fix this problem?

Here is my code,

<div class="form-group">
            @Html.LabelFor(model => model.MusteriId, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">              
                @(Html.Kendo().ComboBox()
          .Name("MusteriId")
          .Filter("contains")
          .Placeholder("Müşteri seçiniz...")
          .BindTo(ViewBag.MusteriId as SelectList)
          .Suggest(true)
          .HtmlAttributes(new { style = "width: 600px;" })
                )
                @Html.ValidationMessageFor(model => model.MusteriId, "", new { @class = "text-danger" })
            </div>
        </div><div class="form-group">
            @Html.LabelFor(model => model.AracId, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">               
                @(Html.Kendo().ComboBox()
          .Name("AracId")
          .Filter("contains")
          .Placeholder("Araç seçiniz...")
          .BindTo(ViewBag.AracId as SelectList)
          .Suggest(true)
          .HtmlAttributes(new { style = "width: 85%;" })
                )
                @Html.ValidationMessageFor(model => model.AracId, "", new { @class = "text-danger" })
            </div>
        </div>
Artuğ
Top achievements
Rank 1
 answered on 28 Sep 2015
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?