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

following is my code, but not bind to model
                @Html.Kendo().CheckBoxGroupFor(m => m.weekOfDay).Items(i =>
                {
                    i.Add().Label("ma").Value("1");
                    i.Add().Label("di").Value("2");
                    i.Add().Label("wo").Value("3");
                    i.Add().Label("do").Value("4");
                    i.Add().Label("vr").Value("5");
                    i.Add().Label("za").Value("6");
                    i.Add().Label("zo").Value("0");
                }).Layout("horizontal")

 

cannot find any online information.

Georgi Denchev
Telerik team
 answered on 24 Mar 2021
3 answers
903 views

I have a read-only grid with paging enabled. It is retrieving the pages via AJAX. Is it possible to configure the grid to only make a AJAX request once for each page and to cache it after that? For example, when the user selects page 2, it makes an AJAX request to retrieve the page 2 records. Then the user selects page 1 again. I don't need it to go back to the server to request these. If it becomes stale, the user can just refresh the whole page. It sounded like the dataSource.transport.cache could do this, but I can't find any way of accessing that via the fluent DataSourceBuilder and it has next to no documentation. I tried setting ServerOperation to false thinking that might control caching, but that just prevented the paging params from being sent with the AJAX request. Can the Grid do this? Here is how my Grid is declared:

@(Html.Kendo().Grid<BatchHistoryVM>()
    .Name("grd-batch-history")
    .Columns(columns =>
    {
        columns.Bound(c => c.BatchNumber).Title("Batch #").HeaderHtmlAttributes(textCenterAttr);
        columns.Bound(c => c.BatchDate).Title("Batch Date").HeaderHtmlAttributes(textCenterAttr).HtmlAttributes(textCenterAttr).Format("{0:d}");
        columns.Bound(c => c.BatchAmount).Title("Batch Amount").HeaderHtmlAttributes(textCenterAttr).HtmlAttributes(textCenterAttr).Format("{0:c}");
        columns.Bound(c => c.SettledBy).Title("Settled By").HeaderHtmlAttributes(textCenterAttr).HtmlAttributes(textCenterAttr);
    })
    .Pageable()
    .NoRecords("There is no batch history available")
    .Selectable(selectable =>
    {
        selectable.Mode(GridSelectionMode.Single);
        selectable.Type(GridSelectionType.Row);
    })
    .Pageable(c => c.AlwaysVisible(false).ButtonCount(5))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model => { model.Id(bh => bh.BatchID); })
        .PageSize(2)
        .ServerOperation(true//Ask the server to do paging/sorting/filtering/grouping rather than doing it client-side on the already loaded data
        .Read(read => read.Action("BatchHistory_Read", "MPC"))
        .Events(events => events
            .Error("clm.MPC.batchHistoryGrid_onError")
        )
    )
    .Navigatable()
    .Deferred() //Wait for kendo script to load at the bottom of the page
)
Georgi
Telerik team
 answered on 24 Mar 2021
5 answers
1.1K+ views

Hi,

We are looking to upgrade your application. Currently it uses:

Telerik.Web.Mvc Version 2011.3.1115.235 (Extensions) 

Telerik.Web.UI Version 2013.3.114.35 (Telerik RadControls for ASP.NET Ajax)

The Telerik ASP.Net Ajax I can update using the Wizard tool however the Telerik.Web.Mvc Extensions is no longer supported. 

I am wondering what is the best way to replace it with the current Telerik standard?

Thanks,

Neli
Telerik team
 answered on 24 Mar 2021
4 answers
101 views

     Hi. I'm trying to find the current PageSizes for a grid. I know that I can get the current PageSize with GetOptions, but I haven't find a way to get all the PageSizes.

    Is there a way to do it using GetOptions? or the only way will be to get the values directly from the dropdown?

    Thanks.

 

Alex
Top achievements
Rank 1
 answered on 23 Mar 2021
3 answers
122 views

Is there anyone know why the MultiSelect works fine for the first item. After first one select, it will not work properly( please see the screen shot). type a letter then all matched item will be selected. Click any one then the box will reset.

cshtml

      @(Html.Kendo().MultiSelect()
              .Name("Users")
              .DataTextField("FullUserInfo")
              .DataValueField("UserID")
              .Placeholder("Type Last Name or First Name")   
              .DataSource(source => {
                  source.Read(read =>
                  {
                      read.Action("GetFilterUser", "Method");
                  })
                  .ServerFiltering(true);
                })
            )

 

Controller

        [HttpGet]
        public JsonResult GetFilterUser(string text)
        {
           
            personList = (IEnumerable<UserListboxDataViewModel>)
                       dataService.GetAllPersonsforListBox();

            if (!string.IsNullOrEmpty(text))
            {
                personList = personList.Where(p =>
                    (p.FullUserInfo.Contains(text))).ToList();
            }

            return Json(personList, JsonRequestBehavior.AllowGet);
        }

Allen
Top achievements
Rank 1
Veteran
 answered on 23 Mar 2021
2 answers
132 views

I have an MVC application running on the C: drive of my web server.  I need to access files on the same machine, but a different drive, located at D:\Files.

I can't find an example of how this is accomplished.  The FileManager demo uses the application content folder for file storage, so that is not much help in this instance.  I've searched this forum, google and SO but I can't find a working example of how this is accomplished.  Most of the answers I've found simply point back to the FileManger demo without any explanation.

I would certainly appreciate any insight you can provide for this topic.

Thanks!

Jason
Top achievements
Rank 1
 answered on 23 Mar 2021
1 answer
103 views
Hi - we'd like to host one of our webapps in another app.  ie. in app1, we'd like to if possible have a menu option, window, whatever, that opens up access to our other internal webapp.  We're thinking something similar to iframes but are wondering if there is a browser control or something similar in Telerik's arsenal that we could use for this.  If we could pass in a particular URL to go to then even better.  Essentially, we want multiple webapps to appear as if they are the same app to the users.
Dimitar
Telerik team
 answered on 23 Mar 2021
1 answer
100 views

Hi,

I would like to know if there is a way to define custom shapes or to get predefined shapes as in Syncfusion (i.e. question or diamond) when using diagram with ASP.NET MVC

thanks

Ray

Georgi Denchev
Telerik team
 answered on 22 Mar 2021
11 answers
880 views

Is there a way I can accomplish the following using the MVC wrapper?

https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/various/foreign-key-column-sorting-by-text

 

 

Tsvetomir
Telerik team
 answered on 19 Mar 2021
1 answer
1.3K+ views

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, &amp;#39;myForm&amp;#39;, &amp;#39;/Home/Save&amp;#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

 

Neli
Telerik team
 answered on 19 Mar 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?