Telerik Forums
UI for ASP.NET MVC Forum
1 answer
667 views
I have a dropdown list of vehicle makes.  I want a list view of vehicle models that should only be enabled and populated with data when a make is chosen from the dropdown.   Is this possible?

<script type="text/javascript">
    function filterModel() {
        return {
            VehicleType: $("#VehicleType").val(),
            Make: $("#Make").val()
        };
    }
</script>


<%: Html.Kendo().DropDownListFor(i => i.Make)
                .Name("Make")
                .DataTextField("Make")
                .DataValueField("Make_Code")
                .DataSource(source => {
                    source.Read(read =>
                        {
                            read.Action("GetCascadeMakes""Home")
                                .Data("VehicleType");
                        })
                        .ServerFiltering(true);
                    })
                .OptionLabel("Please Select")
                .CascadeFrom("VehicleType")
                .Enable(false)
                .AutoBind(false)
                 %>


<%: Html.Kendo().ListView<Project.Models.ViewModel>()
            .Name("Model")
            .TagName("div")
            .ClientTemplateId("Models")
            .DataSource(datasource =>
                {
                    datasource.Read(read => read.Action("GetCascadeModels""Home")
                        .Data("filterModel"));
                })
            .Selectable(selectable => selectable.Mode(ListViewSelectionMode.Multiple))
        %>

Vladimir Iliev
Telerik team
 answered on 18 Sep 2012
2 answers
989 views
I am working on Kendo UI with asp.net mvc razor. I am trying to bind database table data with kendo grid that supports CRUD operations. Here i need to populate a dropdownlist for one of my table field. I have used the following code


**View:**


    @model IEnumerable<MvcApplication1.PriceOption>    
    @(Html.Kendo().Grid(Model)
            .Name("Grid")
            .Columns(columns =>
            {
                //columns.Bound(p => p.ProductTitle).ClientTemplate("<input type='checkbox' disabled='disabled'name='Discontinued' <#= Discontinued? checked='checked' : '' #> />");
                columns.Bound(p => p.ProductTitle).EditorTemplateName("OptionalEmail");
                columns.Bound(p => p.OptionTitle);
                columns.Bound(p => p.Price);
                columns.Bound(p => p.Frequency);
                columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
        
        
        
            })
            .ToolBar(toolbar => toolbar.Create())
                .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine))
            .Pageable()
            .Sortable()
            .Scrollable()
            .DataSource(dataSource => dataSource
                .Ajax()
                .Events(events => events.Error("error_handler"))
                .Model(model => model.Id(p => p.ProductID))
                .Create(create => create.Action("CreateOption", "ZiceAdmin"))
                .Read(read => read.Action("Read", "ZiceAdmin"))
                .Update(update => update.Action("UpdateOption", "ZiceAdmin"))
                .Destroy(update => update.Action("DeleteOption", "ZiceAdmin"))
            )
        )


**OptionalEmail.cshtml**


    @model string
    @(Html.Kendo().DropDownList()
        .Name("ProductTitle")
        .Value(Model)
        .SelectedIndex(0)
        .BindTo(new SelectList(ViewBag.ProductTitle))
     )


Here i need to store the selected item from the dropdownlist. But it always shows null. How could i get the selected value from dropdownlist.
Gibi
Top achievements
Rank 2
 answered on 17 Sep 2012
3 answers
559 views

Hey There I have the following code which looks ok to me (but i'm new to MVC), when I tab out of the combobox or submit the form no validation messages are displayed. After submitting to controller, the modelstate.Valid is True.

VIEW
<div class="field-label">
    @Html.LabelFor(model => model.Name.TitleID)
 </div>
 <div class="feild-Entry">
     @(Html.Kendo().ComboBoxFor(model => model.Name.TitleID)
         .DataTextField("Description")
         .DataValueField("ID")
         .BindTo(Model.Titles)
      )
      @Html.ValidationMessageFor(model => model.Name.TitleID)
</div>

MODEL - Title Propery in Name Object
[Range(1, 5000) ]
[RequiredAttribute]
public int TitleID { get; set; }

 
HTML Output
 <!-- Title-->   
        <div class="field-label">
            <label for="Name_TitleID">TitleID</label>
        </div>
        <div class="feild-Entry">
            <input data-val="true" data-val-number="The field TitleID must be a number." data-val-range="The field TitleID must be between 1 and 5000." data-val-range-max="5000" data-val-range-min="1" data-val-required="The TitleID field is required." id="Name_TitleID" name="Name.TitleID" type="text" value="0" /><script>
 jQuery(function(){jQuery("#Name_TitleID").kendoComboBox({dataSource:[{"ID":0,"Code":null,"Description":"Not Selected"},{"ID":20,"Code":"","Description":"Captain"},{"ID":9,"Code":"","Description":"Dr"},{"ID":21,"Code":"","Description":"Judge"},{"ID":15,"Code":"","Description":"Miss"},{"ID":2,"Code":"","Description":"Mr"},{"ID":6,"Code":"","Description":"Mrs"},{"ID":19,"Code":"","Description":"Ms"},{"ID":23,"Code":"","Description":"President"},{"ID":27,"Code":"","Description":"Professor"},{"ID":22,"Code":"","Description":"Reverend"},{"ID":16,"Code":"","Description":"Sir"}],dataTextField:"Description",dataValueField:"ID"});});
</script>
            <span class="field-validation-valid" data-valmsg-for="Name.TitleID" data-valmsg-replace="true"></span>
        </div>

 
But no client side validation is displayed for the combo box, other text based input boxes show their validation i.e required etc...

Please Help, Im not sure whats going on here!!!

Daniel
Telerik team
 answered on 17 Sep 2012
1 answer
360 views
Is it possible to use a scroll bar instead of paging for a list view?
Nikolay Rusev
Telerik team
 answered on 17 Sep 2012
0 answers
106 views
I have been trying to use the examples of the k- widgets and their styling from the demo's and none of them seem to be working except for the themes.

Also, I can't get any tables to style with a custom CSS. What could be overriding the stylings?
axwack
Top achievements
Rank 1
 asked on 16 Sep 2012
0 answers
203 views
Hello,

I have a MVC View that displays raw XML.  The view display properly and I don't have a bug or anything with the Kendo MVC window.  I just don't know how to make the Window display the page from the server, not content or template data on the client-side.  Basically, when I click a button that opens the window, I want it to show a specific URL like:  /MyXmlController/FileID=100.

Is this possible?  Non of the demos show how to do this.  I don't want to use a IFRAME if I don't have to. 

- Rashad
Rashad Rivera
Top achievements
Rank 1
 asked on 16 Sep 2012
0 answers
137 views

Hi,

Following is the code 

<form id="Form1" runat="server">
<div id="ContentDiv">
<% Html.Kendo().Window()
.Name("ContactUsWindow")
.Title("Contact Us.")
.Draggable(false)
.Resizable(resizing => resizing
.MinHeight(300)
.MinWidth(300)
.MaxHeight(500)
.MaxWidth(500)
)
.Actions(actions => actions.Close())
.Content(() =>
{%>
<p>This is window Demo</p>
<%})
.Width(300)
.Height(300)
.Render();
%>

</div>

<% Html.Telerik().ScriptRegistrar()
.OnDocumentReady(() => {%>
var windowElement = $('#ContactUsWindow');
var undoButton = $('#undo');
undoButton
.bind('click', function(e) {
windowElement.data('tWindow').open();
undoButton.hide();
})
.toggle(!windowElement.is(':visible'));

windowElement.bind('close', function() {
undoButton.show();
});
<%}); %>
<span id="undo" class="t-group">Click here to open the window.</span>
</form>

When I close the window the undo button is not working. Is there something I missed to implement?

Regards,

Yeou

Yeou
Top achievements
Rank 1
 asked on 14 Sep 2012
0 answers
99 views

Hello,
 I am very new to Kendo UI. Thanks for providing the Demos which  are dam good and very useful for the beginners.

Have an issue with tree view.
Scenario:
I have two tree views.
First tree view contains options to add, delete, reorder the nodes in the second tree view.
Add- appends a node using Append method.
Reorder – Move the selected node up or down using the methods insertAfter and insertBefore

When am adding a node with some selection in the second  tree view, it appends the node as the last node to the second tree and selection on the second tree view is retained.

But when I reorder the nodes using the above mentioned methods  with some selection on second tree view, the selection was not retained after reordering.
Can anyone help me in retaining the selection .

Thanks,
Harika.

Harika
Top achievements
Rank 1
 asked on 14 Sep 2012
0 answers
185 views
So I have 2 trees, one pulls data that consists of parent and child nodes and another that has the same. What I want to do is to allow a user to drag and/or double click on a node, whether it be a child or a parent and add that to the other treeview. If though an action is done to move a child node from one tree to another and the same parent exists in both, then that child node, whether user drags and drops or double clicks will automatically route to the correct parent node. This way, a user couldn't accidently move a child node into the wrong parent node. I really hope this makes sense as I have tried several things to no avail and had assumed that this would be more straight forward. 

Thanks much.
Mark
Top achievements
Rank 1
 asked on 13 Sep 2012
1 answer
150 views
Hi,

So just working through the mobile demo (http://docs.kendoui.com/tutorials/build-apps-with-kendo-ui-mobile) and I am attempting to use the MVC wrappers where applicable, for instance tabstrip.

It would appear that they don't pick up the styles and js properly and don't render quite as they should.

so this code:

@Html.Kendo().TabStrip().Name("tabstrip").Items(items =>
                {
                    items.Add().Text("Home").Action("Index", "Home");
                    items.Add().Text("About").Action("About", "Home");
                })

doesn't pick up the mobile style and ignores the 
transition: 'slide'

setting. 

Are the wrappers supposed to work with a mobile app project?
Iliana Dyankova
Telerik team
 answered on 13 Sep 2012
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?