Telerik Forums
UI for ASP.NET MVC Forum
2 answers
590 views

I have two dropdowns, the second "cascading" from the first.  This works fine except that when the user first goes into the page, the model has the values for the first and second dropdowns (Model.ProgramID and Model.StrategyID).  The first dropdown selects the correct item in the list, but the second dropdown (the cascade one) does not automatically select the item equal to the value from the model, it just selects the first item in the list.  If I turn cascading "off" and just load them without cascading stuff set, they both get set to the correct selected items in their respective dropdowns based on the values in the model.

<div class="form-input-group">
    <label>Program</label>
    @(Html.Kendo().DropDownList()
    .Name("ProgramID")
    .DataTextField("Display")
    .DataValueField("Value")
    .HtmlAttributes(new { style = "width:100%" })
    .OptionLabel("Select")
    .DataSource(s =>
    {
        s.Read(r =>
        {
            r.Action("RemoteDataSource_GetFirmPrograms", "DropDownList", new { userAccountID = Model.UserAccountID, firmID = Model.FirmID });
        });
    })
    .Height(290)
)
</div>
 
<div class="form-input-group">
    <label>Strategy</label>
    @(Html.Kendo().DropDownList()
    .Name("StrategyID")
    .DataTextField("Display")
    .DataValueField("Value")
    .HtmlAttributes(new { style = "width:100%" })
    .OptionLabel("Select")
    .DataSource(s =>
    {
        s.Read(r =>
        {
            r.Action("RemoteDataSource_GetFirmStrategies", "DropDownList").Data("filterStrategies");
        })
       .ServerFiltering(true);
    })
    .Height(290)
    .AutoBind(true)
    .CascadeFrom("ProgramID")
)
</div>
Robert
Top achievements
Rank 1
Veteran
 answered on 08 Oct 2020
8 answers
2.1K+ views
When starting or converting a project to a Kendo MVC project, the css and js are copied into a "kendo/(build#)" folder within the "Content" and "Scripts" folders respectively.

Your documentation on using MVC bundling with Kendo works just fine. My only issue is it requires the css/js to be in the root "Content" and "Scripts" folders and not where they are put by default.

I'm just trying to understand this because the project layout conflicts with your documentation. I have tried the bundling when the files are where the wizard puts them and I could not get it to work. Are we supposed to just manually copy/dupe the content each release?

Ideally a nuget package for the MVC wrappers would be used, but I just want to know how to best work around the way it currently is.
Dimitar
Telerik team
 answered on 08 Oct 2020
2 answers
969 views

Hello,

I defined my class field “TeamCode” as string type and it only accept 4 characters.  I want edit box stop accept any characters more than it's length limitation. if user try to enter 5th character in the box the cursor should not move since max length defined on that box is 4.  It works well in regular Kendo TextBox. But it does not work on Kendo grid cell when do the same thing. Length limitation does not happen in the cell except when cell lose cursor. Is anyone have an idea to make it work? (Below are partial of code). Thanks in advance.

 

Field in class:

            [StringLength(4, MinimumLength = 4, ErrorMessage = "{0} must be 4 characters.")]

             [DisplayName("Team Code")]

             public string TeamCode { get; set; }

 

Code take action in individual textbox:

@Html.Kendo().TextBoxFor(model => model.TeamCode).HtmlAttributes(new { maxlength = 4})

 

 

Code does not take action in Kendo Grid cell editor:

...

columns.Bound(m => m.TeamCode).Width(100).HtmlAttributes(new { maxlength = "4"});

...

Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 07 Oct 2020
6 answers
550 views
 function poWizardReset(e) {
    if(e.sender.currentStep.options.index === 0) {
        $initPo.val('');
        $initPart.val('');
        $initLineItem.value('');
        $initAckId.value(0);
    }
 
    if (e.sender.currentStep.options.index === 1) {
        $initVerifyPo.val('');
        $initVerifyStockRoom.val('');
        $initVerifySupCode.val('');
        $initVerifySupName.val('');
        $initVerifyLineItem.val('');
        $initVerifyPart.val('');
        $initVerifyUoM.val('');
        $initVerifyAllowed.value(0);
    }
 
    if (e.sender.currentStep.options.index === 2) {
        $finalPart.val('');
        $finalPo.val('');
        $finalLineItem.val('');
        $finalAllowed.value(0);
        $finalPrinterId.value(0);
 
        $finalPackingSlip.val('');
        $finalQuantity.value(0);
        $finalCarrierTracking.val('');
        $finalCarrierId.value(0);
        $finalMulti.checked(false);
    }
 
    if (e.sender.currentStep.options.index === 3) {
    }
}

 

On the reset button click and the corresponding event, how would I navigate between the steps?

 

 

 

 

Headygains
Top achievements
Rank 1
Veteran
 answered on 07 Oct 2020
1 answer
803 views

How can I have two or more TextBoxes in same line?

<div class="form-group row">
    @Html.LabelFor(m => m.MobileNumber, new { @class = "col-sm-2 col-form-label" })
    <div class="col-sm-4">
        @Html.TextBox("MobileNumberPrefix", "+9715", new { @class = "k-textbox", style = "width: 28%;", @readonly = "readonly" })
        @Html.TextBoxFor(m => m.MobileNumber, new { maxlength = "8", @class = "k-textbox", style = "width: 100%;", placeholder = "9715XXXXXXXX" })
    </div>
    @Html.LabelFor(m => m.UserEmail, new { @class = "col-sm-2 col-form-label" })
    <div class="col-sm-4">
        @Html.TextBoxFor(m => m.UserEmail, new { maxlength = "150", @class = "k-textbox", style = "width: 100%;", placeholder = "Email Address" })
    </div>
</div>

 

I want to show MobileNumberPrefix and MobileNumber together in the col-sm-4

Anton Mironov
Telerik team
 answered on 07 Oct 2020
1 answer
826 views

Following the exact example here:

https://github.com/ftamminga/KendoUISignalRApp/blob/master/KendoUISignalRApp/Views/Home/Index.cshtml

My application works on initial load (e.g. create, destory, etc) but if I refresh the page (f5), OnDisconnected gets called by the client never reconnects. But if I had the empty client side method, it works:

hub.client.create = function () { console.log('create1'); };

 

I would think setting the client side kendo grid properties (e.g. Read, Create, Destroy, Update) would created/binded to the necessary client side methods. Am I doing something wrong? 

 

 

Tsvetomir
Telerik team
 answered on 07 Oct 2020
1 answer
117 views

Hello,
I needed splitview for my existing asp.net mvc application. Since this feature is not in bootstrap, I want to integrate the splitview structure of kendo into my home / index page. But I could not find an example exactly like the link(https://demos.telerik.com/kendo-ui/m/index?&_ga=2.175873698.1093150333.1601874386-452789549.1601620086#splitview/index). Is there a version of the same example in the link made in mvc?

 

If I can integrate a structure like in the link into my home index page, I am thinking of buying the license of Kendon.

Tsvetomir
Telerik team
 answered on 07 Oct 2020
5 answers
671 views
     Hi, I used to be able to do my controller and Grid by right clicking on controller add new controller and a bunch of telerik options would pop up that allowed me to add it all with ease. I no longer have that option.  I used to have a area called "Other" that was there also, and it's not available. Did you guys get rid of it? I'm using 2019 Profession VS. 
Vesko
Telerik team
 answered on 06 Oct 2020
1 answer
1.0K+ views

Hi

I'm just wondering if this is possible to achieve in telerik grid, i have a grid that handles transactions record that surely will have huge number of records thousands or maybe millions, i have pagination allowed, here is the question, is this possible to read for example 10 records per page literally in the database but display also the number of pages and total records?

Anton Mironov
Telerik team
 answered on 06 Oct 2020
6 answers
891 views

Hi 

 I have this grid. It retrieves 3000+ rows every time opened. It only shows 1st 20 rows. Is there a way to retrieve rows as needed?

Say retrieve 1st 20 rows and then next 20 if user clicks on page 2?

@(Html.Kendo().Grid<PartnerLink.Models.CaseMainGridDisplay>
    ()
    .Name("grid")
    .Columns(columns =>
    {
    columns.Bound(c => c.ASSIGNMENT_ID).Hidden(true);
    columns.Bound(c => c.CASE_REFERENCE).Title("Case Ref").Width(105);
    columns.Bound(c => c.FIRST_NAME).Title("First Name");
    columns.Bound(c => c.SURNAME).Title("Last Name");
    columns.Bound(c => c.status).Title("Status");
    columns.Bound(c => c.DaysAtStatus).Title("Days At Status").Width(135);
    columns.Bound(c => c.CallAgent).Title("Call Agent");
    columns.Bound(c => c.CustomerAdvisor).Title("Customer Advisor");
    columns.Bound(c => c.DATE_CREATED).Title("Created On").Format("{0:dd/MM/yyyy}");
    })
    .Events(evt => evt.Change("onChange").DataBound("onDataBound"))
    .Scrollable()
    .Groupable()
    .ToolBar(tools =>
    {
        if (isExcel)
        {
            tools.Excel();
        }
    })
    .Excel(excel => excel
    .AllPages(true)
    .FileName("CasesList.xlsx")
    .Filterable(false)
    .ProxyURL(Url.Action("Export_Excel", "Home"))
    )
    .Sortable()
    .Resizable(resize => resize.Columns(true))
    .Filterable(ftb => ftb.Mode(GridFilterMode.Menu))
    .Selectable(selectable => selectable
    .Mode(GridSelectionMode.Single)
    .Type(GridSelectionType.Row))
    .Pageable(pageable => pageable
    .Refresh(true)
    .PageSizes(true)
    .ButtonCount(5))
    .DataSource(dataSource => dataSource
    .Ajax()
    .Sort(sort => sort.Add("ASSIGNMENT_ID").Descending())
    .Read(read => read.Action("Assignments_Read", "Home").Data("filterParams")))
);

Alex Hajigeorgieva
Telerik team
 answered on 06 Oct 2020
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
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
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
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?