Telerik Forums
UI for ASP.NET MVC Forum
0 answers
261 views
Hi,
I am using MVC architecture with webAPI. I have used kendo grid with Popup edit feature, and when I click on "Add new record" link then a popup appears with the various fields. I want to validate my username field. The validation on username is to check whether the entered username is unique or not. If the username is not unique, then it should raise a validation saying that "Username is not unique". For this purpose, I want to write a custom validation for kendo grid which will call the server side function and return the value as true if the username is not unique to my client side function and raise a validation message. Is there a way by which I can validate my kendo grid by writing custom validation or custom rule.

Kindly help me with this issue.

Regards,
Sneha
Sneha
Top achievements
Rank 1
 asked on 31 Jul 2012
1 answer
281 views
Why on earth is my html.kendo.dropdownlist showing the id of the field I've selected below the dropdown in a textbox.

 

 @(Html.Kendo().ComboBox()
                .HtmlAttributes(new { style = "width:250px;" })
                .Name("categories")
                .Placeholder("Select category...")
                .DataTextField("CategoryName")
                .DataValueField("CategoryId")
                .DataSource(source => {
                    source.Read(read => {
                        read.Action("GetCascadeIndustries", "Home");
                    });
                })
            )

I get the dropdown
[             >]
[              ] - and the field below it.

Georgi Krustev
Telerik team
 answered on 31 Jul 2012
10 answers
272 views
I have an existing site that I would like to convert from mvc extensions to kendo.  However I am having problems with using a legacy theme (WebBlue).  I have added the WebBlue folder to content and the supporting .css files.  I am including them in my master page as follows:
<link href="<%= Url.Content("~/Content/kendo.common.min.css") %>" rel="stylesheet" type="text/css" />
<%--        <link href="<%= Url.Content("~/Content/kendo.blueopal.min.css") %>" rel="stylesheet" type="text/css" />--%>
<link href="../../Content/telerik.common.css" rel="stylesheet" type="text/css" />
<link href="../../Content/telerik.webblue.css" rel="stylesheet" type="text/css" />
<script src="<%= Url.Content("~/Scripts/jquery.min.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/kendo.web.min.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/kendo.aspnetmvc.min.js") %>" type="text/javascript"></script>

The resulting controls however are only barely themed.  The buttons are white and the highlight colours are off (see attached).  Am I doing something wrong?
ahoads76
Top achievements
Rank 1
 answered on 30 Jul 2012
4 answers
228 views
Can we get an estimated time frame on when you will have all the old Telerik ASP.NET MVC Extensions themes available in Kendo UI for ASP.NET MVC?
Thanks.
loi
Top achievements
Rank 1
 answered on 30 Jul 2012
1 answer
230 views
I've read through the introduction to using KendoUI with ASP.NET MVC about 10 times now to quadrupal check that I've referenced the Kendo.Mvc.dll assembly and included the correct namespaces in my /Views/web.config file. I've rebuilt the project and solution, restarted Visual Studio and even restarted my machine... but I still can't get the Html Helpers to work in this project.

In a new/clean ASP.NET MVC 3 project I can simply follow the instructions referenced above and everything works fine. Thinking this might offer some clues, I did a diff between the new/clean project file and my project and made sure that my project references all of assemblies referenced by the clean project. Similarly I ran a diff between the /Views/web.config file for that clean project and my own /Views/web.config file.

However, after all of that, I still can't get the KendoUI Html Helpers working in this project.

I've read all the forum posts I can find, all of which were resolved by the original posters simply by rebuilding their projects... obviously a solution that hasn't worked for me.

Clearly there is a requirement that is not documented somewhere and which I haven't been able to detect through any of the diff operations that I've run... but I'm totally stumped here.

Any ideas? I'm interested in using KendoUI but with a Linq to SQL backend, creating Serialisable DTOs for all of the Linq Entities etc. and hand coding all of the JSON CRUD operations is a lot of work/maintenance... so I was really hoping to get the MVC extensions working in order to take the grunt work out of this.

Cheers,
Jimmy
Atanas Korchev
Telerik team
 answered on 30 Jul 2012
0 answers
172 views
Hopefully there is a simple answer to this, but I can't seem to find much about it.

I have an MVC grid Ajax-bound, working nicely, with single column sorting.  I can remember the selected row and reset it very nicely on grid redisplay.

However, I'd like to be able to remember the currently sorted column too, so that when I post a request to the server to change the data displayed, I can retain the previous column sort order in the updated display.

I can't see any client-side functions to get or set column sort status, nor anything to handle it server side.  Poking around in the browser script debugger, I could not see where the column sort orders are held - though I don't spend too  long on it. 

Am I missing something obvious?

Cheers
Mark
Mark
Top achievements
Rank 1
 asked on 30 Jul 2012
3 answers
334 views
I am using a boolean field to add a grouping to a grid.  The field has been given the following model attributes

[Display(Name = "COMMON TASK")]
public bool CommonTask { get; set; }

If I INCLUDE the field property as a bound field, the grid is correctly displaying the group by text as "COMMON TASK".  But displaying the field BOTH as a group by and a bound field is doubling up.  So I only want to display the value as a group by.

So when i remove the bound column, the group by text reverts back to "CommonTask", which is the property name and discards the display name attribute.

Is there a way if explicitly setting the group by text or is this a bug with Kendo.

The fist image shows the correctly formatted group by text, BUT the field is included as a bound field and a group by field.
The second image shows the field only used as a group by within the datasource and the display attribute being ignored.
Rosen
Telerik team
 answered on 30 Jul 2012
6 answers
357 views
Hi,

what is the status of the localization feature in the july final-release?
In the migrating-from-telerik-extensions-for-asp.net-mvc-FAQs you mentioned:
"The Telerik Extensions for ASP.NET MVC offer the ability for all components to be localized using resource files. As it stands right now, in the beta, Kendo UI for ASP.NET MVC does not contain an equivalent for localization. However, this will change in a future release."

When will localization of the different widgets (espacially for the Grid) be available?
For us that is a dealbreaker in using Kendo UI for ASP.NET MVC instead of the existing Telerik Extensions.

Regards,
Michael.
Michael Sogos
Top achievements
Rank 1
 answered on 30 Jul 2012
1 answer
831 views
I'm using Ajax binding, with the Destroy command.  The controller method fails with a business exception, which I add to the ModelState with the AddMModelError method.  This is then returned at the end of the method with the ModelState.ToDateSourceResult().
In the UI I have the error event of the grid hooked up, which correctly displays the error as expected.  However, the "deleted" row is still removed from the Grid.  Am I doing something wrong?
Burke
Top achievements
Rank 1
 answered on 28 Jul 2012
2 answers
376 views
Hi,

I've tried to implement the client side selection from the original MVC examples http://demos.telerik.com/aspnet-mvc/razor/grid/selectionclientside. I've done this by using the additional data mechanism and everything looks okay until the first refresh after selection. I've verified that the javascript function is called for additional data at the time of the refresh and that the parameter to be passed has the changed value but I'm getting a null in the controller.

I have two grids in my view

Parent

@(Html.Kendo().Grid<OemGridRow>(Model.Oems)
    .Name("OemGrid")
    .Columns(column =>
    {
        column.Bound(p => p.Title);
    })
    .DataSource(dataSource => dataSource
            .Ajax()
            .Events(events => events.Error("error_handler"))
            .Model(model => model.Id(p => p.Id))
            .Read(read => read.Action("GetOems", "Customer"))
    )
    .Pageable()
    .Sortable()
    .Scrollable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
    .Events(events => events.Change("onOemChange"))
)

Child

@(Html.Kendo().Grid<CustomerGridRow>()
    .Name("CustomerGrid")
    .Columns(column =>
    {
        column.Bound(p => p.Title);
    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.Id))
        .Read(read => read.Action("GetCustomers", "Customer").Data("getOemId"))
    )
)

Javascript

var OemId;
 
function onOemChange(e) {
    // Get the grids
    var oemGrid = $('#OemGrid').data('kendoGrid');
    var customerGrid = $("#CustomerGrid").data("kendoGrid")
 
    // Set OemId to the selected id of the Oem
    OemId = $.map(this.select(), function (item) {
        var dataItem = oemGrid.dataItem(item);
        return dataItem.Id;
    });
 
    // Read the datasource again
    customerGrid.dataSource.read();
}
 
//
function getOemId() {
    // Return the updated OemId
    return {
        filterId: OemId
    };
}

Controller

public ActionResult GetCustomers([DataSourceRequest]DataSourceRequest request, string filterId)
{
    Guid oemId = filterId.ToGuid();
 
    // Omitted
 
    return Json(customers.ToDataSourceResult(request));
}

Can anybody point me in the direction of where I'm going wrong.

Thanks in advance
Darren
Darren Mann
Top achievements
Rank 1
 answered on 27 Jul 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?