Telerik Forums
UI for ASP.NET MVC Forum
6 answers
2.5K+ views

I have a grid with a datetime column that needs to be batch edited. The column has to be custom formatted that is different than the default format of the culture.

The code looks something like:

columns.Bound(product => product.DateField).Format("{0:dd.MM.yyyy}")

 

Also I have added the templates from Kendo src for Date/DateTime.  @(Html.Kendo().DateTimePickerFor(m => m))

 

When I edit I always get the message "The field DateField must be a date".

I even tried to change the template with .ParseFormats(new string[] { "dd.MM.yyyy" }) but still I get the same message.

 

Can the datetimepicker be used in editing grid with custom format?

Alexandra
Top achievements
Rank 1
 answered on 21 Jul 2017
1 answer
934 views

There are two parts to this question:

First, I am trying to add a column to the grid that looks normal, but will turn into a NumericTextBox when clicked into, and back to normal when clicked out. Originally, before I added .ClientTemplate, the cell looked normal and then would turn into a basic textbox when I click into it. After adding the .ClientTemplate, what shows up is a textbox initially (strange), that will SOMETIMES turn into a NumericTextBox when I click into it. There is no telling when this will happen or not. Additionally, if it does happen to turn into a NumericTextBox, when I click on the up or down arrows, the value will change for about .10 seconds and the switch back to the original value.

Second, I want an action to run that will redirect through my controller to update the model after I click off the NumericTextBox so that everything stays up to date. I do not want to have an "update" button because that is too inconvenient for the user, who will be trying to fill out the form as fast as possible.

Here is my Kendo Grid code (it should be noted that my onChangeNumeric function never fires):

@(Html.Kendo().Grid<FrictionGraphProgram.Models.FrictionMaterialModel.TempRawMaterial>()
.Name("RawPaperGrid")
.DataSource(dataSource => dataSource //Configure the Grid data source.
    .Ajax() //Specify that Ajax binding is used.
    .Read(read => read.Action("GetCurrentIngredients", "NewMaterial").Data("rawPaperGridFunctionRef"))
    .Events(events => events.Error("error_handler"))
    .Model(model =>
    {
        model.Id (p => p.id );
        model.Field(p => p.name).Editable(false);
        model.Field(p => p.percent).Editable(true);
    })
)
.Columns(columns =>
{
    columns.Command(ingredient => ingredient
        .Custom("Delete")
        .Text(" ")
        .Click("deleteIngredient")
        .HtmlAttributes(new { title = "Delete Ingredient",
            style = "height:32px;width:32px;min-width:32px;min-height:32px;background-image:url('"
                + Url.Content("~/Images/if_Delete_1493279.png")
                + "');background-color:rgba(0, 0, 0, 0);border-color:rgba(0, 0, 0, 0);",
            functionRef = "DeleteRawPaperIngredient"}))
        .Width(54);
    columns.Bound(ingredient => ingredient.name).Title("Raw Ingredient");
    columns.Bound(ingredient => ingredient.percent).Title("Percent %").Width(200).ClientTemplate(Html.Kendo().NumericTextBox<float>()
        .Name("ingredient_#=name#")
        .HtmlAttributes(new { value = "#=percent#" })
        .Format("{0:n0}")
        .Min(0)
        .Max(100)
        .Step(1)
        .Decimals(0)
        .Events(ev => ev.Change("onChangeNumeric"))
        .ToClientTemplate().ToHtmlString());
})
.Editable(x => x.Mode(GridEditMode.InCell))
.Sortable() // Enable sorting
.Scrollable(scr => scr.Height(173))
.HtmlAttributes(new
{
    type = "grid",
    functionRef = "DeleteRawPaperIngredient",
    gridRef = "#RawPaperGrid"
})
)
Viktor Tachev
Telerik team
 answered on 21 Jul 2017
5 answers
270 views

Hi,

I use ExpressiveAnnotations (https://github.com/jwaliszko/ExpressiveAnnotations) to use annotation-based conditional validation mechanisms in my forms.
(RequiredIf and AssertThat)

Now my question regarding Kendo MVC Grid Validation:

  • is it correct, that Kendo Grid validation is only possible with "KendoValidation" and not with JQuery validation? (also in custom popup editor template?)
  • is it possible to use ExpressiveAnnotations with "KendoValidation"?

robert

Viktor Tachev
Telerik team
 answered on 21 Jul 2017
3 answers
340 views

I have kendo editor inside of modal in a tabstrip window.

My Kendo editor is defined as below - 

            @(Html.Kendo().Editor()
                    .Name("instEditor")
                    .Tag("div")
                    .Encode(false)
                    .Tools(tools => tools
                            .Clear()
                            .Bold()
                            .Italic()
                            .Underline()
                            .Strikethrough()
                            .JustifyCenter().JustifyFull().JustifyLeft().JustifyRight()
                            .CreateLink().Unlink().TableEditing().FontColor().BackColor())
                            .Value(Model.IContent)                           
            )

 

I am getting the text in Kendo editor form database.

Whenever I run the application and Kendo editor renders, editor is loaded properly. When I click inside the editor, the toolbar pops up as expected. 

But as soon as I select a text in the editor or basically whenever I mousedown in the editor second time after initially entering into the editor, the toolbar disappears. And it does not appear back until I click outside of the editor and then click back inside the editor. 

How can I solve this issue?

 

Thanks!

 

 

Veselin Tsvetanov
Telerik team
 answered on 21 Jul 2017
1 answer
737 views

Hi,

Our development team updated the Telerik Kendo MVC components to 2017 R2 Version. After this update the all MultiSelect always shown the loading icon.
How can I hide this gif icon from all MultiSelect?

Ivan Danchev
Telerik team
 answered on 21 Jul 2017
1 answer
1.1K+ views

I am trying to create a page with grid format and I used kendo controller also installed kendo in my system but its showing me this error. I have used code first entity framework for the code.

 [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult companys_Create([DataSourceRequest]DataSourceRequest request, company company)
        {
            if (ModelState.IsValid)
            {
                var entity = new company
                {
                    companyname = company.companyname
                };

                db.companys.Add(entity);
                db.SaveChanges();
                company.companyid = entity.companyid;
            }

            return Json(new[] { company }.ToDataSourceResult(request, ModelState));
        }

 

I am getting error at httpverbs. Can anyone give a solution.

Bozhidar
Telerik team
 answered on 21 Jul 2017
2 answers
377 views

Assume I have created Testcontroller and added a Testcombobox control in views(Eg. TestView.cshtml). I implements the function and return data is working fine. Now I added existing Testcombobox control in different Controller (eg. Test1View1.cshtml and Test1Controller) is not loading data and it getting error like uncaught TypeError: Cannot read property 'slice' of undefined.

 

Eg ComboControl.

 @(Html.Kendo().ComboBoxFor(m => m)
        .Name("cbtest")
        .Placeholder("--Select--")
        .DataSource(source => source
                            .Custom()
                            .ServerFiltering(false).Transport(transport => transport

                            .Read(read =>
                            {
                                read.Action("TestAction", "Test");
                            }))
                            .Schema(schema => schema.Data("Data")
                                                .Total("Total")
                                                .Errors("errors")))
        .MinLength(3)
        .AutoBind(true)
        .Filter(FilterType.Contains)
        .DataValueField("sTestEntCode")
        .DataTextField("sTestText")

 

Is there anything missing code or reference?

Note: Using Area Controller and the same control added another area controller.

Suman
Top achievements
Rank 1
 answered on 21 Jul 2017
1 answer
128 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.8K+ 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
235 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
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
AICodingAssistant
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
+? 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?