Telerik Forums
UI for ASP.NET MVC Forum
1 answer
226 views
When doing an inline edit in a grid, unobtrusive validation doesn't work (I have only tried inline mode so far). I know the older telerik grid would wrap the grid in a form element, but I'm not sure if this is the only reason the validation doesn't work or if it manually occurred under the hood. My input elements in edit mode are getting correct data-val-* attributes but they aren't being evaluated on the client prior to adding/editing.

Any feedback would be appreciated.
Adam
Top achievements
Rank 1
 answered on 31 Jul 2012
1 answer
540 views
Hello I need help to find how to write 2 events.
1_ OnDatabinding not exist inEvents(events => events....
2_ OnComplete not exist in Events(events => events....

In KendoUI I not find how to write the events "DataBinding" and "Complete" to call javascript functions.

@(Html.Kendo().Grid(Model.Sors)
        .Name("Grid")
        .EnableCustomBinding(true)
        .Columns(columns =>
        {
            columns.Bound(o => o.TransactionId).Width(20).Title("<input id='selectAll' type='checkbox' /").Sortable(false);
            columns.Bound(o => o.StaffName).Width(100).Title(LocaleUtil.Get(GuestMessageKeys.StaffName));
            columns.Bound(o => o.BuildingName).Width(100).Title(LocaleUtil.Get(BuildingMessageKeys.Building));
            columns.Bound(o => o.DateTime).Width(120).Title(LocaleUtil.Get(GlobalMessageKeys.DateTime)).Format(TelerikUtil.GetShortDateTimeFormat());
            columns.Bound(o => o.TransactionId).Width(30).Title(LocaleUtil.Get(GlobalMessageKeys.Change)).Sortable(false);
        })
        .Events(events => events.DataBound("Grid_OnDataBound"))
        .Events(events => events.DataBinding("Grid_OnDataBinding"))
        .Events(events => events.Complete("Grid_OnComplete"))
        .DataSource(dataBinding => dataBinding
            .Ajax()
            .Read("_KCustomBinding", "MassSorUpdate", new { Area = "MassProcessing" })
            .Total(Model.SorsTotal))
        .Pageable()
        .Sortable()
    )

My javascript
// Send additional data to the grid action method, in this case the ComboBox selected value.
function Grid_OnDataBinding(e) {
    e.data = { id: $("#UpdateType").val() };
    // uncheck select all combo
     $("#selectAll").attr("checked", false);
}
 
var totalGridRecords = 0;
function Grid_OnComplete(e) {
    totalGridRecords = e.response.total;
}
 
function Grid_OnDataBound(e) {
    e.row.cells[0].innerHTML = "<input type='checkbox' name='checkedRecords' value='" + e.dataItem.TransactionId + "' />";
    e.row.cells[4].innerHTML = "<a href='javascript:;' onclick='ShowSorDetailPopup( { transactionId: \"" +e.dataItem.TransactionId+ "\"})'>" + msgDetail + "</a>";
}

My customBinding where I need an "int id"
[GridAction(EnableCustomBinding = true)]
        public ActionResult _KCustomBinding([DataSourceRequest(Prefix = "Grid")] DataSourceRequest request, int id)
        {
            if (request.PageSize == 0)
            {
                request.PageSize = 10;
            }
 
            ViewClientFilter<SorDTO> viewClientFilter = new ViewClientFilter<SorDTO>();
            viewClientFilter.AddPageCount(request.PageSize);
            viewClientFilter.AddPageIndex(request.Page);
 
            ClientFiltersResponse<SorDTO> list = this.MassSorUpdateRepository.GetMassSorUpdatesList(id, viewClientFilter);
 
            return View(new GridModel
            {
                Data = list.Data,
                Total = list.Total
            });
        }

So how can I write these two events for the grid?
1_ DataBinding
2_ Complete

In Telerik I have this:
....
.ClientEvents(s => s.OnRowDataBound("Grid_OnDataBound"))
            .ClientEvents(s => s.OnDataBinding("Grid_OnDataBinding"))
            .ClientEvents(s => s.OnComplete("Grid_OnComplete"))
            .DataBinding(dataBinding => dataBinding.Ajax().Select("_CustomBinding", "MassSorUpdate", new { Area = "MassProcessing" }))
            .Pageable(settings => settings.Total(Model.SorsTotal))
            .EnableCustomBinding(true)
            .Sortable()

UPDATE:
==================================


Now I made this change and the grid call the action
.Ajax()
            // Enable batch mode
            .Batch(true)
            .Read(read => read.Action("_KCustomBinding", "MassSorUpdate", new { Area = "MassProcessing" })
                .Data("Grid_OnDataBinding"))
            .Total(Model.SorsTotal)

But it give me a null reference error on Sorts:
if (request.Sorts.Count == 0)   <= Sorts is = null or undefined

Petur Subev
Telerik team
 answered on 31 Jul 2012
3 answers
903 views
I'd like to use a Kendo grid in batch edit mode, but need to mark certain columns as readonly.  Is this feature supported?  If so, please advise as to how I can do this.  If not, could you advise as to when we can expect this?

EDIT: I see that this is still an issue in the Q2-2012 KendoUI release.  Please advise if/when you will be supporting this feature?
Mathias
Top achievements
Rank 1
 answered on 31 Jul 2012
0 answers
267 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
290 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
281 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
229 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
234 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
179 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
347 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
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?