Telerik Forums
UI for ASP.NET MVC Forum
8 answers
928 views
Hi everyone,
    I have a page that has a grid which I've set the editing mode to PopUp.
When I click edit on an item, a modal window pops up and it's content is using a partial view based on the Entities I'm editing.
This entities has lots of data which I've separated into sections using a tabStrip.
Each tabstrip should display infos from the entities of the item I've clicked.
I've tried to use LoadContentFrom which loads the content once and after that, it's always the same so, it's not practical when I click on another item's edit button.
So, I've tried the .Content method which works fine but, the model used is empty, nothing is set in it.

What would be the best approach to this scenario?

Thanks.
Stéphan Parrot
Top achievements
Rank 1
 answered on 19 Sep 2012
3 answers
366 views
Hi,
I am using Kendo grid in my application and all the Create,  Update and Delete operation are  being fired in the conroller.
 These are the following Actions in the HomeController which are not firing when i click on Save Changes button in the grid:

Editing_Create
Editing_Update
Editing_Destroy

I am attaching a sample code for the same.

Regards,
Nandan

Please find the Updated attached file


Rosen
Telerik team
 answered on 19 Sep 2012
0 answers
86 views
any ideas on why this would work for the 1st pop-up, but not after? Thank you!

    function SelectorOnChange(e) {
        switch (e) {
            case 1:
                $("#divQuote").show();
                $("#divJob").hide();
                $("#divCustomer").hide();
                break;
            case 2:
                $("#divCustomer").show();
                $("#divJob").hide();
                $("#divQuote").hide();
                break;
            default:
                $("#divJob").show();
                $("#divQuote").hide();
                $("#divCustomer").hide();
                break;
        }
    }

MelF
Top achievements
Rank 1
 asked on 18 Sep 2012
1 answer
671 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
996 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
564 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
367 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
107 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
209 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
145 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
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?