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

Hi All,

       In my date picker date coming as invalid. i mean moth coming as 48. why? Please see attached screen shot

 

 

Viktor Tachev
Telerik team
 answered on 20 Jul 2017
3 answers
1.9K+ views
Is there anyway to remove the items that have been selected from the dropdown list already?  For instance, the multiselect functionality changed somewhere between 2014 - 2016.  The list used to only show items that were not already selected.  Now it shows all items and it shows items that have already been selected by highlighting them.  Is there an option to make it hide the selected items from list?  What was the reasoning behind changing the functionality?
Nencho
Telerik team
 answered on 20 Jul 2017
2 answers
320 views

Is there a way to change the title of the "Export to Pdf" button for localization purpose for example.

 

Michel
Top achievements
Rank 1
 answered on 19 Jul 2017
6 answers
235 views

Hi,

We are looking to asynchronously upload a file and temporarily store it in the AppData folder. The widget works perfectly when uploading pdf files, but for some reason it triggers a full postback when we try to upload a jpg file.

For context, here are some code snippets from the view and controller:

View

@(Html.Kendo().Upload().Name("uploadDocuments")
          .Async(a => a
              .Save("Upload", "Home")
              .AutoUpload(true)))

 

Controller

public ActionResult Upload(HttpPostedFileBase[] uploadDocuments)
        {
            foreach (var document in uploadDocuments)
            {
                var fileName = Path.GetFileName(document.FileName);
                var uploadPath = Server.MapPath("~/App_Data");
                var physicalPath = Path.Combine(uploadPath, fileName);
                document.SaveAs(physicalPath);
            }

            // Return an empty string to signify success
            return Content("");
        }

We're using Kendo for ASP .NET MVC version 2017.2.621. Any help is greatly appreciated.

Thanks!

Ivan Danchev
Telerik team
 answered on 17 Jul 2017
2 answers
225 views

Hi,

I am working on Asp.Net MVC Grid (MVC 5 2017.1.223)  Please see the below code details.

@(Html.Kendo().Grid<EditableTest>()
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(c => c.testID).Hidden();
            columns.Bound(c => c.testDesc).Title("City Description");
            columns.Bound(c => c.testCode).Title("Country");
            columns.Command(command => { command.Edit(); command.Destroy(); }).Width(250);
        })
        .ToolBar(toolbar => { toolbar.Create(); })
        .Editable(ed => ed.Mode(GridEditMode.PopUp))
        .Sortable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .Filterable()
        .DataSource(dataSource => dataSource
            .Custom()
            .PageSize(20)
            .Schema(schema => schema.Model(m => m.Id(p => p.testID)))
            .Transport(transport =>
            {
                transport.Read(read => read.Url("http://localhost:60018/api/testapi").DataType("json"));
                transport.Create(create => create.Url("http://localhost:60018/api/testapi").Type(HttpVerbs.Post).DataType("json"));
                transport.Update(Update => Update.Url("http://localhost:60018/api/testapi").Type(HttpVerbs.Put).DataType("json"));
                transport.Destroy(del => del.Url("http://localhost:60018/api/testapi").Type(HttpVerbs.Delete).DataType("json"));                
            })
        )
)

 

This is custom Grid with web api. Read and create is work fine but update and destroy is not working. Is there any missing code. I understand for Put and Delete need to pass parameter thru web Api. I think I already added scheme for ID.  Appreciate your help on this. :)

 

Regards
Suman G

Suman
Top achievements
Rank 1
 answered on 17 Jul 2017
2 answers
488 views

Hi,

I've a kendo grid with a delete option for each row. Delete an item and it is removed from the list and the dete from the data context performs successfully. However when I delete another row, it tries to perform the delete of the first deleted row a 2nd time, cant find the entity and throws an error, so the 2nd item is not deleted.

Code as follows -

View

 

@(Html.Kendo().Grid<OriginGreen.Areas.Portal.Models.DisplayArticleViewModel>()
        .Name("Article")
        .Columns(columns =>
        {
            columns.Bound(p => p.Id).Title("Id").Visible(false);
            columns.Bound(p => p.Title).Title("Title").Width(100);
            columns.Bound(p => p.AticleTypeDesc).Title("Article Type").Width(100); ;
            columns.Bound(p => p.AticleCodeType).Title("Article Type").Visible(false);
            columns.Bound(p => p.PublishedOn).Format("{0:dd/MM/yyyy HH:mm:ss}").Width(150).Title("Date Published").Width(100);
            columns.Command(command => command.Destroy()).Width(40);
            columns.Template(x => { }).ClientTemplate("<a class='k-button k-button-icontext k-grid-EditArticle' href='" + Url.Action("Edit", new { id = "#= Id #" }) + "'>Edit</a>").Width(30);
 
 
        })
        .Events(e => e.DataBound("onRowBound")
        )
        .Pageable()
        .Sortable()
        .Scrollable()
        .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
        .DataSource(dataSource => dataSource
                                .Ajax()
                                .ServerOperation(false)
                                .PageSize(10)
                                .Batch(true)
                                .Model(model =>
                                {
                                    model.Id(p => p.Id);
                                    model.Field(p => p.Title);
                                })
                                .Read(read => read.Action("DisplayArticlesRead", "Article").Type(HttpVerbs.Get))
                                .Destroy(destroy => destroy.Action("ArticleDestroy", "Article").Type(HttpVerbs.Post))
                            )
 
    )

 

Server-side -

 

[AcceptVerbs(HttpVerbs.Post)]
        //public ActionResult ArticleDestroy([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<DisplayArticleViewModel> articles)
        public ActionResult ArticleDestroy([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<DisplayArticleViewModel> articles)
        {
            if (articles.Any())
            {
                foreach (var article in articles)
                {
                    // Delete Any Article Attachments first, so as not to leave orphaned records
                    var articleAttachments = _articleRepository.GetArticleAttachments(article.Id);
 
                    if (articleAttachments.Count > 0)
                    {
                        foreach (var articleAttachment in articleAttachments)
                        {
                            _articleRepository.DeleteAttachment(articleAttachment.AttachmentId);
                        }
                    }
 
                    _articleRepository.DeleteArticle(article.Id);
                }
            }
 
            //return Json(articles.ToDataSourceResult(request, ModelState));
            return Json(articles.ToDataSourceResult(request, ModelState));
        }

 

I've read up on it and it seems I need to return a success indicator to the grid but I cant work out how to do this in an mvc setup.

Any help greatly appreciated.

Terry.

 

Stefan
Telerik team
 answered on 17 Jul 2017
2 answers
572 views

How can I specify the id of the record as an optional parameter in the UrlAction?

@model IEnumerable<proITdesk.Database.Models.Address>

...

<script type="text/x-kendo-tmpl" id="template">

    <a href='@Url.Action("Details", "Addresses", new { Id = "#=Id#" }.ToString())'>
        <div class="widget-primary">
            <h4 style="text-align:center">#:Name#</h4>
            <img src="@Url.Content("~/content/web/foods/")#:Id#.jpg" alt="#:Name# Image" />
        </div>
    </a>
</script>     
Harald
Top achievements
Rank 2
 answered on 16 Jul 2017
8 answers
397 views

My website was working fine till last week, during which there seems to have been a chrome update.

The issue is right when my page loads, we have a search field, but the cursor does not display, even after i click with mouse pointer on the text box. I am able to type and do search, but the cursor does not appear, which says there is something wrong.

But once inside, I have another masterpage and here there are few jQuery validations. But even after the user enters the required values, keep getting "Those values required" error message. We use jquery validate, but even after we tried kendo validator the same issue remains. I cannot proceed from this page.

Once i close the browser and come back, the issue seems to be resolved some time. But its very inconsistent and we cannot suggest that to production. FireFox has no issues, so its something related with Chrome.

If i am loading the page in developer mode (F12), there seems to be no issue too. This happens only in the deployed version and right after clearing the cache of the browser. It has to be do with some scripts not loading, but I am not able to test it since, all scripts are loaded and working when doing it in developer mode.

IT
Top achievements
Rank 1
 answered on 14 Jul 2017
10 answers
257 views

I have a treeview set up as below ("treeview"), and the rendered checkboxes are not styled according to the theme (bootstrap).  If I set up another treeview with local data ("treeview1"), they render as themed.  Any hints as to how i can get the checkboxes to adhere to the theme when using a datasource?

 

NOT THEMED:

@(Html.Kendo().TreeView()
        .Name("treeview")
        .Checkboxes(checkboxes => checkboxes.Name("checkedCategories")
        .CheckChildren(true))
        .Events(events => events.Check("onCheck"))
        .DataTextField("description")
        .DataSource(dataSource => dataSource
            .Model(m => m.HasChildren("HasChildren").Children("Children"))
            .Read(read => read.Action("GetFilters", "ProductList")))
          )

THEMED:

@(Html.Kendo().TreeView()
        .Name("treeview1")
        .Checkboxes(checkboxes => checkboxes.Name("checkedCategories"))
        .Items(treeview =>
       {
           treeview.Add().Text("Asset Class").Id("1-1")
               .Expanded(true)
               .Items(category =>
               {
                   category.Add().Text("My first thing").Id("2-1");
                   category.Add().Text("My Second Thing").Id("2-2");
               });
       }))

Magdalena
Telerik team
 answered on 14 Jul 2017
9 answers
333 views
Kendo MVC 2014.3.1516

Bug:
If you use a MultiSelectFor in an EditorTemplate, the grid's "save" event will only fire once for that cell.  The second time you update the same cell (by picking an additional item or removing an item from the MultiSelect list), the grid's save event is not called.
Georgi
Telerik team
 answered on 14 Jul 2017
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
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
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?