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

Hello

I have a very weird bug. I have a page on MVC that displays two editors and gets passed a model with the value for both editors. The model is as follows:

public class BulletinsModel
    {
        [AllowHtml]
        [Display(Name = "Some Bulletin")]
        public string SomeBulletin { get; set; }
 
        [AllowHtml]
        [Display(Name = "Other Bulletin")]
        public string OtherBulletin { get; set; }
    }

I then, defined a view which receives this view model and maps it to two kendo editors.There is also some javascript code to make a post to update the information. 

@model BulletinsModel
 
<div id="settings">
    <div class="form-horizontal">
        <div class="form-group">
            @Html.LabelFor(m => m.SomeBulletin, new { @class = "col-md-6 text-left" })
            @(Html.Kendo().EditorFor(m => m.SomeBulletin).Encode(false).Name("Some_Bulletin"))
 
            @Html.LabelFor(m => m.OtherBulletin, new { @class = "col-md-6 text-left" })
            @(Html.Kendo().EditorFor(m => m.OtherBulletin).Encode(false).Name("Other_Bulletin"))
        </div>      
    </div>
</div>

My code for my action method that renders this view is as follows (nothing fancy):

[HttpGet]
public PartialViewResult Index()
{
    ViewBag.ActiveSectionName = "Bulletins";
    var bulletinModel = GetBulletinsModel();
    return PartialView("_Bulletins",bulletinModel);          
}

However, my issue is that after hitting the Index action a couple of times, the editors become non responsive and I cannot edit the information on them. This only happens on IE, as I have not been able to replicate the issue in other browsers.

 

 

Luis
Top achievements
Rank 1
 answered on 17 Jun 2016
5 answers
69 views

On my form, I disabled dates. However, when a user manually keys in a date that is disabled, it seems to clear the input. This then gets passed on to my custom validation rules as a "" (empty string) instead of the date entered. Is there a way to prevent the datepicker from clearing its input when the user keys a disabled date in?

Sunny
Top achievements
Rank 1
 answered on 17 Jun 2016
1 answer
151 views

Hi,

I am uploading an excel file and display it into spreadsheet. I want that when i upload an excel file, i fetch the records(say: ABC Class type) from posted file and validate using fluent validation. If there are any validation failure then it will be marked on the spreadsheet.

Slav
Telerik team
 answered on 17 Jun 2016
3 answers
462 views

We have what SHOULD be a simple SSN entry field:

@Html.Kendo().MaskedTextBoxFor(model => model.SSN).Mask("000-00-0000").UnmaskOnPost(true).HtmlAttributes(new { @class = "form-control", style = "width:125px" })

The problem we're having is that if we leave some digits not filled in (i.e. - "555-33-2"), no error is thrown.  Aren't the 0s supposed to be required digits?

Also, we have a regex attribute on the field in the model, for validations when NOT using the edit form (seeds, etc.).  We're planning to disable it by adding the Html attribute @data_val = "false".  Will that prevent the maskedtextbox from doing its work?

Georgi Krustev
Telerik team
 answered on 17 Jun 2016
3 answers
213 views

I'm trying to pass the selected rows in a grid to a controller action and I keep getting "kendo.grid.min.js:11 Uncaught TypeError: Cannot read property '1' of undefined" as an error.

I am not 100% sure what is undefined exactly. I have rows selected. If I break out the javascript to see that there are selected items I get them back just fine. The items that are selected have data for all 3 columns as well, so I am kind of lost on to what is undefined. My razor view code is below, thanks.

001.@model SealRecommendationViewModel
002. 
003.@{
004.    ViewBag.Title = "Recommended Seal Models";
005.}
006. 
007.@{ Html.EnableClientValidation(false); }
008. 
009.@using (Html.BeginForm("RecommendedSealModels", "SealRecommendation", FormMethod.Post, new { id = "recommendedSealModels" }))
010.{
011.    <div class="separator">
012.        <h2>Recommended Seal Models</h2>
013.    </div>
014.    <div>
015.        @(Html.Kendo().Grid(Model.SealRecommendationObjects)
016.                .Name("FilteredGrid")
017.                .Columns(columns =>
018.                {
019.                    columns.Bound(s => s.SealTechnology).Title("Technology").Width(100);
020.                    columns.Bound(s => s.CategoryCode).Title("Seal Model").Width(100);
021.                    columns.Bound(s => s.Name).Title("Model Name").Width(100);
022.                })
023.                .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))
024.                //.Sortable()
025.                .DataSource(data => data.Server().Model(m => m.Id(p => p.ProductID)))
026.                .Events(events => events.Change("selectSealRecommendation"))
027.        )
028.        <button id="btnBackBtn" class="buttonLeft" type="button" value="Back" onclick="location.href='@Url.Action("Index", "SealRecommendation")'">Back</button>
029.        <button id="btnSolution" class="buttonRight" type="submit" value="Next" style="" onclick="submitSelectedSealModels();">Next</button>
030.    </div>
031.}
032. 
033.<script type="text/javascript">
034.    $(document).ready(function () {
035.        //Default functionalities
036.        var checkSeals = $('input:checkbox[id^="checkedSealModel"]:checked');
037.        $("#btnBackBtn").click(function () {
038.            window.location = '@Url.Action("Index", "SealRecommendation")';
039.        });
040.        if (checkSeals.length > 0) {
041.            $('#btnSolution').removeAttr("disabled");
042.        }
043.        else {
044.            $("#btnSolution").attr("disabled", "disabled");
045.        }
046.        //CheckBox click event
047.        $("input[id ^= 'checkedSealModel']")
048.            .on('click',
049.                function() {
050.                    var checkedSeals = $('input:checkbox[id^="checkedSealModel"]:checked');
051.                    if (checkedSeals.length > 0) {
052.                        $('#btnSolution').removeAttr("disabled");
053.                    }
054.                    if (checkedSeals.length < 1) {
055.                        $('#btnSolution').attr("disabled", "disabled");
056.                    }
057.                    if ($('input:checkbox[id^="checkedSealModel"]').length == checkedSeals.length) {
058.                        $("#checkAllSealModels").attr("checked", true);
059.                    } else {
060.                        $("#checkAllSealModels").attr("checked", false);
061.                    }
062.                });
063.        //CheckAll checkbox click
064.        $("#checkAllSealModels")
065.            .on('click',
066.                function() {
067.                    if ($("#checkAllSealModels").is(':checked') == true) {
068.                        $('#btnSolution').removeAttr("disabled");
069.                        $('input:checkbox[id^="checkedSealModel"]')
070.                            .each(function() {
071.                                $(this).attr('checked', true);
072.                            });
073.                    } else {
074.                        $('#btnSolution').attr("disabled", "disabled");
075.                        $('input:checkbox[id^="checkedSealModel"]')
076.                            .each(function() {
077.                                $(this).attr('checked', false);
078.                            });
079.                    }
080.                });
081.    });
082. 
083.    function submitSelectedSealModels() {
084.        var entityGrid = $("#FilteredGrid").data("kendoGrid");
085.        var selectedItems = entityGrid.dataItem(entityGrid.select());
086. 
087.        var data = selectedItems.toJSON();
088. 
089.        var customerForm = new AjaxForm("recommendedSealModels");
090.        var form = customerForm.getForm(true);
091. 
092.        AjaxServiceCall(form.action, form.method, data);
093.    }
094. 
095.    function selectSealRecommendation(arg) {
096.        var selected = $.map(this.select(), function (item) {
097.            return $(item).text();
098.        });
099.        $('#btnSolution').prop("disabled", false).removeClass("disabled");
100.    }
101.</script>

Kostadin
Telerik team
 answered on 16 Jun 2016
5 answers
1.3K+ views

Hi,

I'm using client side grid dataSource filter: kendo.data.DataSource.filter with operator: "eq", but it returns case insensitive results.

For example:

<script>
var dataSource = new kendo.data.DataSource({
  data: [
    { firstName: "joe", lastName: "doe" },
    { firstName: "Joe", lastName: "Doe" }
  ]
});
dataSource.filter( { field: "lastName", operator: "eq", value: "doe" });
var view = dataSource.view();
console.log(view.length);
</script>

returns 2. 

Is there a way to make it case sensitive?

Thanks,

-Yuriy

 

 

Pavlina
Telerik team
 answered on 16 Jun 2016
5 answers
975 views

Hello,

 

I've a kendo Grid in MVC that used ClientRowTemplate for coloring rows depending on the given data. Now we want to add details grid while keeping the current row template.

I've followed your example in http://demos.telerik.com/aspnet-mvc/grid/detailtemplate

and I was able to add the details grid while I've to remove ClientRowTemplate  in order to have the grid rendered.

I need an example showing how to use the ClientRowTemplate in both main grid and the details one, in MVC.

 

Thanks You!

Radoslav
Telerik team
 answered on 16 Jun 2016
1 answer
86 views

Hi, I'm trying to understand and replicate this demo: http://demos.telerik.com/aspnet-mvc/grid/localization

But since it is missing the source, I'm lost.

When are you going to update this document?

I'm trying to do the exact same thing on my application, I want the user to be able to select the language he/she prefers and see all widgets in that language.

I already have a DropDwonList for the languages and it is already working for the strings in my application, but I don't know how to change the telerik's widgets language.

Can somebody help me, please?

Thanks!

Vessy
Telerik team
 answered on 15 Jun 2016
1 answer
198 views

I am using the WYSIWYG Editor and trying to add a table. We have our own classes we use for the tables, so I am defining those classes at the top of the html and then adding my table in the html view. If I add a table with a class, after hitting update the editor adds the class "k-table" to the table. Is there a way to prevent this?

Thanks,

Jim

Ianko
Telerik team
 answered on 15 Jun 2016
3 answers
179 views

I'm using the "Filter Multi Checkboxes" and I am trying to hook it up to an existing MVC Controller Action which returns JSON data but in a different structure to what is expected.

Currently my code is

columns
    .Bound(p => p.Customer)
    .Filterable(ftb => ftb
        .Multi(true)
        .DataSource(ds => ds
            .Read(r => r
                .Action("Customers_Read", "SalesLedger")
            )
        )
    );

And this expects the action to return data in this structure

[{"Customer":"John"},{"Customer":"Bob"},{"Customer":"Mary"}]
But my action return the data as

["John","Bob","Customer"]

Is this possible?

Thanks â€‹

 

Stefan
Top achievements
Rank 1
 answered on 15 Jun 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
Window
ListView
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
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?