Hi,
How can I achieve calling a custom javascript post call (jQuery) when a user enters the Enter key ? (actually independent of which field has the focus at that moment).
Just like with a classic button submit button, but instead calling a custom js function.
Martin
Hi,
I get a error message 'The field StartDate must be a date.' when I try to set the DatePicker dateformat, like this:
It seems something goes wrong by validating the date value, because of the format.
My code snippet:
items.Add()
.Field(propInfo.Name)
.Label(propInfo.Label)
.Editor(e =>
{
e.DatePicker().Format("dd-MM-yyyy");
});
How can I solve this easily, on the server side (preferably not jQuery / javascript fix).
Hi,
How can I get a vertical scrollbar in the Form component ?
I mean, the form area excl. the buttons.
I'd prefer to achieve this without having to add a css style on the page, but instead achieve this with a simple piece of (serverside) code.
In html/css I can see the following structure
- html form
- div formlayout
- fieldset
- fieldset
I would like to have a vertical scrollbar on the div formlayout I guess. Buttons shouldnt scroll, but stay visible.
In my scenario I have only 1 column of fields, but should work for any amount of columns in layout.
Martin
Hi,
How can I get a textbox in the form fields with 0 decimals ?
There are always 2 decimals now.
Is teher a simple way to do it ? Preferably serverside.
Martin
Hi,
I am creating my own MVC Helper to wrap the Form component (serverside).
Inside that helper, I do something like this to create a custom html input element event:
StringBuilder sb = new StringBuilder();
string strSaveCall = $"SaveDetailItem(null, '{_formName}', '{_saveActionUrl}', null, null);"; // '/Home/Save'
string onkeyDownEvt = _htmlHelper.Raw("if (event.keyCode == 13) { " + strSaveCall + " }").ToHtmlString();
This renders the following html:
<input type="text" id="LastName" name="LastName" ...
onkeydown="if (event.keyCode == 13) { SaveDetailItem(null, &#39;myForm&#39;, &#39;/Home/Save&#39;, null, null); }" ....">
But I would like to see it rendered without the escaped characaters, like:
if (event.keyCode == 13) { SaveDetailItem(null, 'myForm', '/Home/Save', null, null); }"
How can I achieve this ?
Martin
How to render a textarea in the Form? I have the below code, it did increase the height of the textbox, but does not behave like textarea.
items.AddGroup()
.Label("Comments")
.Layout("grid")
.Grid(g => g.Cols(1).Gutter(10))
.Items(i =>
{
i.Add()
.Field(f => f.Comments)
.Label(l => l.Text("Comments:")).InputHtmlAttributes(new { style = "height:80px;" });
});
Thank you!
Hello,
I have a form with different text fields ,dropdown lists and a gridview with some data.
after entering the information in text fields, I have a button that allows me to validate the creation of this new element.
this button must call an action of my controller which is used to generate an excel file where I must call the template of this file from my local files and display the information entered in the fields that correspond in the excel file
I am using npoi library (c #) in back and telerik ui for asp.net mvc
It would be much appreciated if you can help me on this.
Thanks for replying
Hi, I recently found out about the Form widget. I like the look-and-feel so far and tried to use it customized editortemplates loaded from gideditmode.popup with template name. The HTML rendered seems to be fine. I see data-bind attribute with correct binding but grid item data is not bound to the form.
Is my approach supported?
When using a new form to post if adding model state errors with a key value other than string.empty the kendo().form throws error on return to view:
Message "Object reference not set to an instance of an object."string
Source: "Kendo.Mvc"string
Stack trace:
" at Kendo.Mvc.UI.Form`1.BuildItems(IList`1 items)\r\n at Kendo.Mvc.UI.Form`1.WriteInitializationScript(TextWriter writer)\r\n at Kendo.Mvc.UI.WidgetBase.WriteHtml(HtmlTextWriter writer)\r\n at Kendo.Mvc.UI.Form`1.WriteHtml(HtmlTextWriter writer)\r\n at Kendo.Mvc.UI.WidgetBase.ToHtmlString()\r\n at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString()\r\n at System.Web.HttpUtility.HtmlEncode(Object value)\r\n at System.Web.WebPages.WebPageBase.Write(Object value)\r\n at ASP._Page_Views_User_CreateUser_cshtml.Execute() in C:\\CustomerVS2019Projects\\iCepts\\CustomerPortal\\Views\\User\\CreateUser.cshtml:line 17\r\n at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()\r\n at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()\r\n at System.Web.WebPages.StartPage.RunPage()\r\n at System.Web.WebPages.StartPage.ExecutePageHierarchy()\r\n at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)\r\n at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)\r\n at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)\r\n at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)\r\n at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)\r\n at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)\r\n at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)"