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

Here's the definition of the two items that are linked by the CascadeFrom:
                      items.Add().Field(f => f.Country)
                                 .ColSpan(1)
                                 .Name("cmbCountry")
                                 .Editor(e => e.ComboBox()
                                               .AutoWidth(false)
                                               .DataTextField("name")
                                               .DataValueField("id")
                                               .BindTo(@CountryModel.Countries)
                                               .Placeholder("--- Select or Type Country"));
                      items.Add().Field(f => f.StateProvince)
                                 .ColSpan(1)
                                 .Name("cmbStatesProvinces")
                                 .Editor(e => e.ComboBox()
                                               .AutoWidth(false)
                                               .AutoBind(false)
                                               .Placeholder("--- Select State/Province ---")
                                               .DataTextField("name")
                                               .DataValueField("id")
                                               .DataSource(dS => dS.Read(read => read.Action("GetStateList", "Address").Data("filterState")).ServerFiltering(true))
                                               .CascadeFrom("cmbCountry")
                                               @*.BindTo(@StatesProvinces.StateProvince)*@
                                               );

Here's the AddressController.GetStateList:

        public JsonResult GetStateList(string? Country)
        {
            JsonResult? retval = null;
            if (!string.IsNullOrEmpty(Country))
            {   var Country_ID = CountryModel.Countries.Where(s => s.name == Country).ToList()[0].code;
                var State = StatesProvinces.StateProvince.Where(s => s.countryCode == Country_ID);
                retval = Json(State.Select(s => new { id = s.id, name = s.name }).ToList());
            }
            else
                retval = Json(StatesProvinces.StateProvince);
            
            return retval;
        }

 

This works for the first Country that is selected...  afterwards - if the Country is changed, the GetStateList is not called again to refresh the related/CascadeFrom Combobox.

Yanislav
Telerik team
 answered on 26 May 2022
1 answer
18 views

I have a dashboard page made up of several different sections.  Each section is rendered via a Html.Action call.

Is it possible to rearrange these into kendo scripts so the whole page can leverage the TileLayout wrapper? 

I tried below, but it's throwing all sorts of console errors.  The child actions do contain their own javascript scripts which may be the problem perhaps?


    <script id="views-corporatedocuments-template" type="text/x-kendo-template">
        @Html.Action("CorporateDocuments")
    </script>

    <script id="views-lowmargin-template" type="text/x-kendo-template">
        @Html.Action("LowMarginOrders")
    </script>

    <script id="views-lateshipments-template" type="text/x-kendo-template">
        @Html.Action("LateShipments")
    </script>

Eyup
Telerik team
 answered on 25 May 2022
1 answer
19 views

Hello, We are trying to use the Grid Filter & Sort in ASP.NET MVC5.

When we click on filter icon nothing happens "No drop down list to make filter choice " The sorting & paging seems to work fine. Attachments are View markup, Controller code and UI screen.


Srinu
Top achievements
Rank 1
Iron
 answered on 23 May 2022
0 answers
21 views

Hello, We are trying to play with MVC5 samples and in Visual Studio 2019. The web application is working but the data is not loadind and it is just spinning with "Loading Demo". FYI, We have not changed anything in the sample.

 

Would be able to guide me in the right direction so we can maker sure whatever is missing in our dev environment is installed.

Srinu
Top achievements
Rank 1
Iron
 updated question on 23 May 2022
1 answer
19 views

Problem:

I have a search funtionality that loads the folder structure and a second that loads the documents for a folder. Due to dependencies on other systems is the latter a giant performance hit if i have to loop over the folder in an eager loaded system. these same dependencies & preformance impact also block me from excecuting the first webservice on every expand. Documents are only available in leaf folders, as they are a specific type, but that's not relevant to the treeview.

Right now, we have implemented it so that we cache the folder structure, and on every expand we load the cached version & filter out what we needed. Due to cache size limitations, we have settled on a cache time of 30 minutes. We see now that users complain about  the treeview not working anymore when they have been called away, when they had lunch & when they had to work on other things for a while (i.e. when they didn't use the app for more than 30m.

I have managed to eager load the complete folder structure, but that required it to be fully expanded, while most folders should be collapsed. The contents of collapsed folders seems to be ignored. A folder that has been extended but recollapsed however, is kept in the treeview and will not be requested again. We could make a Javascript that would collapse everything, but that would give a nasty flicker on the view.

Question:

I would like to know if there is a way to eager load the collapsed folder structure while keeping lazy loading for the documents.

 

Anton Mironov
Telerik team
 answered on 23 May 2022
2 answers
31 views

hallo,

i just wanna to disable the combobox when the chekcbox is checked and vice versa.

 

when i cheked, it disactivated, but when i check out (isChek == false) is not enable it. so it remain disabled.

 

any idea?

Alan
Top achievements
Rank 2
Iron
Iron
 answered on 21 May 2022
2 answers
22 views

I have a RadGridView with IsFilteringAllowed="True" and CanUserSortColumns="True" properties.  This give my column headers sort and filter functions, and shows the filter icon on each. The columns are defined as GridViewDataColumns.  

I am trying to find a way to remove, or at least hide, the filter icon from just one of my column headers.  Is there a way to do that?

Here is the relevant code:

<telerik:RadGridView Grid.Row="0" ItemsSource="{Binding StationState.DewaxStatuses}"
                                     Style="{StaticResource RadGridViewDefault}"
                                     IsFilteringAllowed="True" CanUserSortColumns="True"

<telerik:GridViewDataColumn DataMemberBinding="{Binding WorkItemsCount}" Header="Molds" 
                                                    Style="{StaticResource GridViewFooterDataColumn}" 
                                                    TextAlignment="Right" ShowFilterButton="False">

I have tried moving the IsFilteringAllowed property into the individual data columns but it isn't valid in those.  I also tried adding FilterMemberPath to the one column, which left the icon visible and the dropdown available but removed the data from the menu.  That is, you could view the menu but there is nothing to select.

I also looked at ShowFilterButton, but that only removes the button inside the menu, not the icon.

I hope this is enough information, but I can supply more if needed.

Thanks,

Todd

Alan
Top achievements
Rank 2
Iron
Iron
 answered on 20 May 2022
1 answer
27 views

I'm updating an application (based on version v2021.2.511) porting bits of code to a new application based on v2022.2.510). I'm trying to get a multi-select drop-down list with checkboxes working.  The requirment is for the check boxes to be checked if an item in the list is selected, and unchecked if it is unselected.

The following styles were added:-


<style type="text/css">

    @*.EditButton {
        display:@ViewBag.EditButton;
    }*@

    .nopadding {
   padding-left: 0 !important;
    padding-right: 0 !important;

}

 .k-multiselect:after {
         content: "\25BC";
         position: absolute;
         top: 30%;
         right: 10px;
         font-size: 10px;
     }

    .k-multiselect-wrap.k-floatwrap li.k-button .k-icon.k-i-close
  {
    display: none !important;
  }

}
</style>

<style scoped>

    .k-widget.k-multiselect {
        width: 300px;
        vertical-align: middle;
        display: inline-block;
    }
</style>

The multiselect definition is:-


 @(Html.Kendo().MultiSelect()
                                .Name("msSpecialty")
                                .DataValueField("Code")
                                .DataTextField("Description")
                                    .Placeholder("All specialties...")
                                    .ItemTemplate("<input type='checkbox' /> #=data.Description#")
                                    .AutoClose(false)
                                    .ClearButton(false)
                                    .TagMode(TagMode.Multiple)
                                //.TagTemplate(" <span>#= Description #</span>")

                                .Events(e => e.Close("onSpecListChange").DataBound("specListDataBound").Change("chkFix"))
                                .DataSource(src => src.Read(rd => rd.Action("getOpenClockSpecDDL", "Validation")).ServerFiltering(false))
                                    .HtmlAttributes(new { style = "width:300px;" })
                        )

And the javascript:-


 var currentSpec = '-X-';

 function onSpecListChange() {
        var items = this.ul.find("li");
        checkInputs(items);
        //check if list has changed since last close, if so, fire change event (Avoids unnescessary requeries)

        var multiselect = $("#msSpecialty").data("kendoMultiSelect");
        var Svalue = multiselect.value().sort();

        var SpecString = "";

        if (Svalue != null & Svalue != '') {


            for (i = 0; i < Svalue.length; i++) {
                SpecString = SpecString + Svalue[i] + "|";
            }

        }
        else {
            SpecString = "-X-";
        }



        if (currentSpec != SpecString) {
            onChange();
        }




    }

    function checkInputs(elements) {
        elements.each(function () {
            var element = $(this);
            var input = element.children("input");

            input.prop("checked", element.hasClass("k-state-selected"));
        });
    }

    function specListDataBound() {

        var items = this.ul.find("li");
        setTimeout(function () {
            checkInputs(items);
        });

    }

    function chkFix() {
        var items = this.ul.find("li");
        setTimeout(function () {
            checkInputs(items);
        });
    }

 function onChange()
    {

    }

I assume the styles have changed between the versions, because this code is not working. The checkboxes aren't being checked on selection, the list doesn't close when clicked away from, and the closed multiselect isn't displaying properly.  How can I get it working as it was please?

Ivan Danchev
Telerik team
 answered on 20 May 2022
0 answers
16 views

Hi,

I use the latest Kendo UI MVC with Visual Studio 2019. I would to know if is possible to change the menu orientation with a button click and not with a combobox option ?

 

Thank you.

Ignacio

José Ignacio
Top achievements
Rank 1
 asked on 19 May 2022
4 answers
521 views

Hi,

I have a kendo MVC grid in a page.in that page i have button. when i click button i want to open a kendowindow popup.

so here is my issue.

when i am clicking that button am saving grid values and  i am opening kendo window popup. so if i have a errors in grid then i dont want to open kendow window popup. how to achieve this.  below is my button click code.

 $("#btnAddProject").click(function (e) {
            var grid = $("#Grid").data("kendoGrid");
            grid.saveChanges();

            var myWindow = $("#AddProjectWindow");
            myWindow.data("kendoWindow").open();
            myWindow.data("kendoWindow").center();
        });

Mr Chuc
Top achievements
Rank 1
Iron
 answered on 19 May 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
sun
Top achievements
Rank 2
Iron
Iron
Iron
Alan
Top achievements
Rank 2
Iron
Iron
Paul
Top achievements
Rank 2
Iron
Veteran
Iron
Ohad
Top achievements
Rank 2
Iron
Iron
Iron
arkan
Top achievements
Rank 2
Want to show your ninja superpower to fellow developers?
Top users last month
sun
Top achievements
Rank 2
Iron
Iron
Iron
Alan
Top achievements
Rank 2
Iron
Iron
Paul
Top achievements
Rank 2
Iron
Veteran
Iron
Ohad
Top achievements
Rank 2
Iron
Iron
Iron
arkan
Top achievements
Rank 2
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?