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

How can I let users paste '   123456  ' into my numeric textbox and have it auto-strip the spaces? There are spaces in the beginning and in the end too. 

currently if there is any space at the beginning or at the end, it doesn't paste anything, show some sign of exclamation and value disappears.

 

<kendo-numerictextbox  k-format="'#'"  ng-model="searchParams.@Model.ParameterName">
        </kendo-numerictextbox>

I also tried this where I am making dynamically kendo control as shown below:

<input kendo-numeric-text-box k-format="'#'"  ng-model="searchParams.@Model.ParameterName" />

I have tried every possible solution, 

Can you please assist how can I achieve this in Angular JS ?

 

Thanks, 

Umair.

Anton Mironov
Telerik team
 answered on 02 Feb 2021
1 answer
699 views

Hi,

I am trying to achieve the functionality of inserting a partial view with grid model property attached to it. Can you please help me?

Tsvetomir
Telerik team
 answered on 02 Feb 2021
1 answer
605 views

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!

Martin
Telerik team
 answered on 01 Feb 2021
1 answer
111 views
Some of the directories I'm listing in the file manager should not be able to accept files being copied or moved into them when an associated record has a certain status. I have scripts working that fire on CopyCommand and MoveCommand, which query a database via an API call. However, I only seem to be able to access the source path in these scripts. Is there a way to also retrieve the destination path?
Neli
Telerik team
 answered on 01 Feb 2021
4 answers
215 views

Working on integrating a Kendo.DropDownList() into a Kendo.Filter object.

It currently works in everyway, other than actually supplying the selected value from the DDL into the datasource / grid binding.

How do I map the Value selected in the Filter Editor Template to the datasource / grid binding. I just need to pass the selected words to be used in the code behind query.

Current Implementation (DDL):

@(Html.Kendo().Filter<KitValidationDtoModel>()
    .Name("filter")
    .ApplyButton()
    .ExpressionPreview()
    .MainLogic(FilterCompositionLogicalOperator.And)
    .Fields(f =>
    {
        f.Add(p => p.OrderId).Label("Davidson Order ID");
        f.Add(p => p.EdiOrderId).Label("EDI Order ID");
        f.Add(p => p.Rfid).Label("RFID Tracker");
        f.Add(p => p.Assy).Label("ASSY");
        f.Add(p => p.Control).Label("Control Point").EditorTemplateId("controlTemplate");
        f.Add(p => p.Ei).Label("End Item");
        f.Add(p => p.Ship).Label("Ship");
    })
    .FilterExpression(f =>
    {
        f.Add(p => p.Control).IsEqualTo("");
        f.Add(p => p.Ship).Contains("");
    })
    .DataSource("dataSource1"))

 

<script type="text/x-kendo-template" id="controlTemplate">
    @(Html.Kendo().DropDownList()
                  .Name("control_filter_dll")
                  .OptionLabel("Select Control Point...")
                  .DataTextField("Control")
                  .DataValueField("Control")
        .DataSource(source =>
        {
            source.Read(read =>
            {
                read.Action("GetControlPoints", "CustomOrder");
            });
        }).Events(e => e.Change("onControlChange")).ToClientTemplate())
</script>

Headygains
Top achievements
Rank 1
Veteran
 answered on 29 Jan 2021
2 answers
989 views

 

Hello,

My MVC project used Kendo Grid with pagination functionality.  How to set width of pagesize dropdown list without impacting other kendo dropdown list in the same page?  Thanks.

 

Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 29 Jan 2021
2 answers
1.2K+ views

When I call the Create method of kendo grid its giving an exception - ''"An item with the same key has already been added". I checked that their is no any duplicate property name in the model, Only one grid on the page. Not sure what causing this error. Appreciate your help in advance.

Inner Exception : 

at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)<br>   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)<br>   at System.Collections.Generic.CollectionExtensions.ToDictionaryFast[TKey,TValue](TValue[] array, Func`2 keySelector, IEqualityComparer`1 comparer)<br>   at System.Web.Mvc.ModelBindingContext.get_PropertyMetadata()<br>   at System.Web.Mvc.DefaultModelBinder.BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor)<br>   at System.Web.Mvc.DefaultModelBinder.BindProperties(ControllerContext controllerContext, ModelBindingContext bindingContext)<br>   at System.Web.Mvc.DefaultModelBinder.BindComplexElementalModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Object model)<br>   at System.Web.Mvc.DefaultModelBinder.BindComplexModel(ControllerContext controllerContext, ModelBindingContext bindingContext)<br>   at System.Web.Mvc.DefaultModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)<br>   at System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor)<br>   at System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor)<br>   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__0(AsyncCallback asyncCallback, Object asyncState)

 

 

Grid : 

@(Html.Kendo().Grid<PersonViewModel>(false)

                            .HtmlAttributes(new { @style = "height: 100%;" })
                            .Name("ContactGrid")
                            .ToolBar(toolbar => toolbar.Create())
                            .toolbar(tools =>
                            {
                                tools.custom().name("addnewcontact").text("add new contact".translate()).htmlattributes(new
                                {
                                    id = "addnewcontact"
                                });
                            })
                            .Excel(e => { e.Filterable(true); e.AllPages(true); e.ForceProxy(true); e.ProxyURL("/Localized/" + nameof(LocalizedController.ExportToExcel)); })
                            .Editable(e =>
                            {
                                e.Enabled(true)
                                .DisplayDeleteConfirmation(true)
                               .Mode(GridEditMode.PopUp).TemplateName("PersonEditor")
                                .Window(w =>
                                {
                                    w.Scrollable(true)
                                    .Resizable()
                                    .Height(245).Width(400);
                                });
                            })

                    .DataSource(datasource => datasource
                    .Custom()
                    .Type("aspnetmvc-ajax")
                    .Transport(t =>
                    {
                        t.Read(r => r.Action("Contacts_Read", "DynamicDiscountingOffer").Data("getAdditionalData").Type(HttpVerbs.Get));
                        t.Create(c => c.Action("Contacts_Create", "DynamicDiscountingOffer").Data("getAdditionalDataToCreateContact"));
                        t.Create(c => c.Action("Contacts_Create", "DynamicDiscountingOffer"));
                    })

                    .Schema(s => s
                    .Model(model =>
                    {
                        model.Id(p => p.VR_PersonId);
                        model.Field(nameof(PersonViewModel.VR_Id), typeof(int?)).DefaultValue(VrId);
                        model.Field(nameof(PersonViewModel.FirstName), typeof(string));
                        model.Field(nameof(PersonViewModel.LastName), typeof(string));
                        model.Field(nameof(PersonViewModel.Email), typeof(string));
                    })
                    .Errors("Errors")
                    .Data("Data")
                    .Total("Total")
                    )
                    .PageSize(10)
                    .ServerSorting(true)
                    .ServerPaging(true)
                    .ServerFiltering(true)
                    .ServerGrouping(false)
                    .ServerAggregates(false)
                    .Events(events => events.Error("error_handler"))
                   )
                   .Pageable(p => { p.Refresh(true); p.PageSizes(new int[] { 10, 20, 50, 100, 200, 2000, 5000 }); })
                    .Columns(columns =>
                    {
                        columns.Bound(c => c.FirstName).Width(140);
                        columns.Bound(c => c.LastName).Width(190);
                        columns.Bound(c => c.Email).Width(250);
                        columns.Command(command =>
                        {
                            ///command.Edit().UpdateText("Submit".Translate()).Visible("editVisible").Text("Edit".Translate());
                            command.Custom("View").Visible("viewVisible").Text("View".Translate()).Click("showDetails");
                            command.Custom("Delete").Visible("deleteVisible").Text("Delete".Translate()).Click("DeleteRow");
                        }).Width(85).MinResizableWidth(85);

                    }
    )
    )

 
[DataContract]
    [Serializable]
    public class PersonViewModel : IValidatableObject
    {
        public int VR_PersonId { get; set; }
 
        [DataMember]
        public int VR_Id { get; set; }
 
        [DataMember]
        public string VendorId { get; set; }
 
        [DataMember]
        public Nullable<Guid> UserId { get; set; }
         
        [DataMember]
        public Nullable<System.DateTime> StartDate { get; set; }

}

 

Anton Mironov
Telerik team
 answered on 29 Jan 2021
2 answers
118 views
I would like my users to be able to renamed or delete files, but not folders. I found the post asking how to prevent subfolders from being created, but delete and renaming seem to be different animals.
Responsive
Top achievements
Rank 1
Veteran
 answered on 28 Jan 2021
1 answer
767 views

Does the ExpansionPanel allow for nested objects within individual panels?

Will it handle the Telerik Grid or Tabs (with even more nesting)?

Is there any change required to make the nested items responsive?

Can the content be loaded using ajax (independently per panel)?

Georgi
Telerik team
 answered on 28 Jan 2021
1 answer
81 views

Hello,

 

I'm trying to show difference between columns on Kendo chart. I made a js function and I have found solution for Kendo UI, I'm trying to rewrite it to Kendo MVC but some issue - with calling js method - occured and don't have idea how can I resolve it.

 

Part of the code:

.Series(series => series.Column(column => column.NewUsers)
    .Name("New users")
    .Color("#007DC5")
    //.Visual("testFunc"))                                       <- it's working
    .Notes(n => n.Visual("testFunc")))                  <- it doesn't

 

so for now the commented line is working, but I've got my values instead of columns. I think the last line should work, because if I understood it well Notes means additional info (and it won't replace with columns), but it doesn't even enter to my method.

My function in js is:

function testFunc(e) { (...) }

 

I tried to do it with something like:

.Notes(n => n.Visual("testFunc()"))

.Notes(n => n.Visual("testFunc(this)"))

 

but in first case 'e' is undefined and in the second case this parameter is not the same as parameter in line which is working (//Visual("testFunc")), so I can't get my data to handle logic.

George Gindev
Telerik team
 answered on 26 Jan 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?