Telerik Forums
UI for ASP.NET MVC Forum
6 answers
602 views
Hello there,

I was wondering if there're any extra steps involved to get the validators to work on Kendo UI controls.  I have a Product model with UnitPrice and Quantity properties.  Both properties are decorated with the [Required] attribute.  In addition the Quantity property has [UIHint("Integer")].  Without the UIHint, Html.EditorFor(obj => obj.UnitPrice) will render out a regular textbox and the required-field validator will work just fine. However the NumericTextBox for the Quantity will not perform any required-field validation.  I also attached a sample project with the setup I described.  If anyone could take a quick look and let me know if I'm missing anything simple, I'd appreciate it.

Thank you,

Ben
PAUL
Top achievements
Rank 1
 answered on 21 Aug 2012
1 answer
220 views
I have a grid that needs to display a check box control in each row conditionally.  For example is the logged on user is the creator of that record, then show the check box, otherwise do not.  I am using Ajax data binding and cannot seem to find any examples of doing this. Are there examples of doing this out there?


Atanas Korchev
Telerik team
 answered on 21 Aug 2012
1 answer
276 views
The method GridRouteValues() is not not available in my controllers.
What have I missed?

RouteValueDictionary routeValues = this.GridRouteValues();
return RedirectToAction("Index", routeValues);

Daniel
Telerik team
 answered on 21 Aug 2012
0 answers
100 views
Hi all,
All elements of kendo ui are very fexible and usable. That is very important but elements as filters, page, and sorts in grids or width in splitter, can be saved state.
states can be saved for future elements entered by means of cookies?
and then set starting these elements obtained from the cookies saved?

The ui framework have any native method for this, or there is that develop any solutions...

best regards
bogamo
Top achievements
Rank 1
 asked on 21 Aug 2012
1 answer
11.3K+ views
I am taking an existing project and adding KendoUI in place of Grid's by another vendor.
The project uses IoC, UnitOfWork etc and so the MVC controllers do not directly use the Context and I cannot see the ToDataSourceResult method.
I have got it mostly working using .Server(), but now want to start using Ajax.


What does ToDataSourceResult do, and how can I replicate its functionality?
Daniel
Telerik team
 answered on 21 Aug 2012
1 answer
974 views
With the Telerik MVC grid it was simple to hide the footer with the .Footer(false) option. There doesn't seem to be a equivalent option for the Kendo grid, unless I missed it?

Anyone managed this?

Thanks!
Trent
Top achievements
Rank 1
 answered on 21 Aug 2012
0 answers
103 views
When any of the ${} below are null, or not provided, it wraps as if the <dd></dd> doesn't exist.  
How do I handle the if(${MiddleName}) !== NULL) then ${MiddleName} for example...

<div class="contact-research-view">         
<dl>             
<dt>Conact Id:</dt><dd>${ContactId}</dd>             
<dt>Honorific:</dt><dd>${Honorific}</dd>             
<dt>First Name:</dt><dd>${FirstName}</dd>             
<dt>Middle Name:</dt><dd>${MiddleName}</dd>             
<dt>Last Name:</dt><dd>${LastName}</dd>             
<dt>Suffix:</dt><dd>${Suffix}</dd>             
<dt>Primary Address Line 1:</dt><dd>${PrimaryAddressLine1}</dd>             
<dt>Primary Address Line 2:</dt><dd>${PrimaryAddressLine2}</dd>             
<dt>Primary Address City:</dt><dd>${PrimaryAddressCity}</dd>             
<dt>Primary Address StateOrProvince:</dt><dd>${PrimaryAddressStateOrProvince}</dd>             
<dt>Primary Address PostalCode:</dt><dd>${PrimaryAddressPostalCode}</dd>             
<hr/>             
<dt>Account Address Line 1:</dt><dd>${AccountAddressLine1}</dd>             
<dt>Account Address Line 2:</dt><dd>${AccountAddressLine2}</dd>             
<dt>Account Address City:</dt><dd>${AccountAddressCity}</dd>             
<dt>Account Address StateOrProvince:</dt><dd>${AccountAddressStateOrProvince}</dd>             
<dt>Account Address PostalCode:</dt><dd>${AccountAddressPostalCode}</dd>             
</dl>     
</div>
Michael
Top achievements
Rank 1
 asked on 20 Aug 2012
2 answers
824 views
I'm using MVC, so the following example:

http://www.kendoui.com/blogs/teamblog/posts/12-04-12/an_in-depth_look_at_the_listview.aspx

Doesn't really help me because i don't have a 'datasource' object in javascript.  What can i use in a simliar fashion for MVC?  I have the following so far
function onchange(e) {
       var lst = $("#lstLPG").data("kendoListView");
   }
but i don't know how to get the selected object from either the 'e' or 'lst' object.
Michael
Top achievements
Rank 1
 answered on 20 Aug 2012
1 answer
273 views
Hi,
I have an MVC4 application and am trying to use the Listview using the MVC wrappers. I am using an edit and a view template. 
 If there are 4 items in my list and I add a new one the Create action is called 5 times, thus 5 records get added.

I am using the latest Q2 trial version. However I previously had downloaded the beta trial version which included an MVC example project which showed the exact same behavour. Is this a bug?   
(Note the same issue occurs for other actions as well)
<div class="k-toolbar k-grid-toolbar">
    <a id="addRoleButton" class="k-button k-button-icontext k-add-button" href="#"><span class="k-icon k-add"></span>Add new Role</a>
</div>
 
    @(Html.Kendo().ListView<iProjX.Models.RoleModel>(Model.Roles)
        .Name("rolesListView")       
        .TagName("div")       
        .ClientTemplateId("rolesList")       
        .Editable()
        .Pageable()
        .DataSource(dataSource => dataSource           
            .Model(model =>
                {
                    model.Id("RoleId");
                    model.Field(f => f.ProjectId).DefaultValue(Model.ProjectId);
                    model.Field(f => f.Title);
                    model.Field(f => f.Description);;
                })
            .Events(e => e               
                .Error("rolesListViewData_error")
                .Change("rolesListViewData_change")
                .RequestStart("rolesListViewData_requestStart"))          
            .Create(create => create.Action("createRole", "Project"))           
            .Read(read => read.Action("getRoles", "Project", new { projectId = Model.ProjectId }))
            .Update(update => update.Action("updateRole", "Project"))   
            .PageSize(30)           
         )
        .Events(e => e
            .Change("rolesListView_change")
            .Edit("rolesListView_edit")
            .DataBound("rolesListView_databound"))     
    )

View Template
//View template
<script type="text/x-kendo-template" id="rolesList">
    <div class="roleView" >
        <div> ${Title} </div>
        <div> ${Description} </div>
        <div class="edit-buttons">
            <a class="k-button k-button-icontext k-edit-button" href="\\#"><span class="k-icon k-edit"></span>Edit</a>
            <a class="k-button k-button-icontext k-delete-button" href="\\#"><span class="k-icon k-delete"></span>Delete</a>
        </div>
    </div>
</script>


Edit template
@model iProjX.Models.RoleModel
 
<div class="roleView" id "newRoleForm2" >
    @Html.ValidationSummary(true)
 
    @Html.HiddenFor(model => model.ProjectId)
    @Html.HiddenFor(model => model.RoleId)
 
    <div class="editor-label">
        @Html.LabelFor(model => model.Title)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Title, new { style = "width:99%", maxlength = 100 })
        <span data-for="Title" class="k-invalid-msg"></span>
    </div>
 
    <div class="editor-label">
        @Html.LabelFor(model => model.Description)
    </div>
    <div class="editor-field">
        @Html.TextAreaFor(model => model.Description, new { style = "width:100%; height:100px"})
        <span data-for="Description" class="k-invalid-msg"></span>
    </div>
 
    <div class="edit-buttons">
        <a class="k-button k-button-icontext k-update-button" onclick="updateClick()" href="\\#"><spanclass="k-icon k-update"></span>Save</a>
        <a class="k-button k-button-icontext k-cancel-button" href="\\#"><span class="k-icon k-cancel"></span>Cancel</a>
    </div>
</div>
Michael
Top achievements
Rank 1
 answered on 20 Aug 2012
12 answers
288 views
I followed the instructions for ajax binding to the T and all i get is a dump of the  JSON on my screen. All the information is there it is just not being put into a grid. HELP!
Here is the code below:

public ActionResult BulkEdit([DataSourceRequest]DataSourceRequest request)
        {
 
            var NewAssets = db.TurnaroundDumps;
            DataSourceResult result = NewAssets.ToDataSourceResult(request);
 
 
            return Json(result, JsonRequestBehavior.AllowGet);
        }
 Then on my view:
@(Html.Kendo().Grid<PcInventory_v1_1.Models.TurnaroundDump>()
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.AssetTag);
        columns.Bound(p => p.SerialNumber);
        columns.Bound(p => p.DeptId);
        columns.Bound(p => p.Location);
    })
    .DataSource(dataSource => dataSource
        .Ajax() // Specify that the data source is of ajax type
            .Read(read => read.Action("BulkEdit", "Assets")) // Specify the action method and controller name
    )
    .Pageable()
 
        
)
mike
Top achievements
Rank 1
 answered on 20 Aug 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?