Telerik Forums
UI for ASP.NET MVC Forum
0 answers
166 views
please delete this post
I fixed a bug
Gusev
Top achievements
Rank 1
 asked on 19 Feb 2013
2 answers
558 views
Hello,
I have the following problem. When I bind an empty list of items to the grid (Server Binding) the grid shows me an empty row. The empty row has a class name "t-no-data" assigned. I could not find the css class "t-no-data" in any of the Kendo CSS files. Because of the prefix "t-" and not "k-" I assume this is a leftover from the Telerik MVC controls.

I just tried to override the "t-no-data" class in my custom css file and set the tr height to 0px to hide the empty row, but that does not work...
.t-no-data
{
    height: 0px;
}

Here is how I defined the Grid in the Razor View:
@* Server Grid-Binding *@
@{
    @(Html.Kendo().Grid(Model)
        .Name("GridWFClasses")
        .Columns(columns =>
        {
            columns.Bound(c => c.ID).Width(50).Title(WFClasses.ColumnID).Hidden(true);
            columns.Bound(c => c.Reference).Template(
                @<text>
                     <a href="javascript:redirectToControllerAction('@item.ControllerUrl')">@item.Reference</a>
                 </text>).Width(150).Title(WFClasses.ColumnReference);
            columns.Bound(c => c.WFTemplateFile.FileName).Width(150).Title(WFClasses.ColumnTemplate);
            columns.Bound(c => c.Description).Width("*").Title(WFClasses.ColumnDescription);
            columns.Bound(c => c.Url).Width(250).Title(WFClasses.ColumnUrl);
            columns.Bound(c => c.EditRights).Width(70).Title(WFClasses.ColumnEditRights);
        })
        .Resizable(m => m.Columns(true))
    )
}
And here is a screenshot so you see what I am talking about:

https://dl.dropbox.com/u/34560718/Kendo_Grid_EmptyLine.png

Can anyone tell me how I can hide the empy line? Thanks.
BigzampanoXXl
Top achievements
Rank 1
 answered on 18 Feb 2013
1 answer
128 views
Have simple model with RegularExpression attribute. This attribute correct work with unobtrusive validation.

public class PersonModel
{
    public int PersonId { get; set; }
    [RegularExpression(@"\+?\d[\d-]+\d")]
    public string Phone { get; set; }
}

Render data in Grid. 

@(Html.Kendo().Grid<PersonModel>().Name("Persons")
    .DataSource(src => src.Ajax()
        .Model(model => model.Id(p => p.PersonId))
        .Read("_GetPersons", "Account")
        .Create("_CreatePerson", "Account")
        .Update("_UpdatePerson", "Account")
        .Destroy("_DestroyPerson", "Account")
        .ServerOperation(true)
    )
    .ToolBar(command => command.Create())
    .Columns(col =>
    {
        col.Bound(p => p.PersonId).Hidden();
        col.Bound(p => p.Phone);
        col.Command(command =>
        {
            command.Edit();
            command.Destroy();
        });
    })
    .Pageable()
    .Editable(e => e.Mode(GridEditMode.PopUp))
)

On edit record in popup editor, have javascript error "SyntaxError: invalid quantifier" because in html field render parameter data-val-regex-pattern="+?d[ds-]+d". All backslashes is disappear. 
ОК, write expression as @"\\+?\\d[\\d-]+\\d". Validation on page is OK, but in action method ModelState.IsValid = false. How can I solve this problem? Code of action method see below.

[HttpPost]
public ActionResult _UpdatePerson([DataSourceRequest] DataSourceRequest request, PersonModel model)
{
    if (model != null && ModelState.IsValid)
    {
        DB.UpdatePerson(model);
    }
    return new JsonNetResult { Data = ModelState.ToDataSourceResult() };
}

Nikolay Rusev
Telerik team
 answered on 18 Feb 2013
5 answers
839 views
I am trying to achieve serverside paging and sorting with Kendo grid. 

I have done the following which is working fine, but this is completely in the JavaScript,

("#appointmentsGrid").kendoGrid({
        columns: [
                    { field: "MemberFirstName", title: "Member<br/>First Name" },
                    { field: "MemberLastName", title: "Member<br/>Last Name" }                   
                 ],
        dataSource: new kendo.data.DataSource({
        serverPaging: true,
        serverSorting: true,
        transport: {
            read: {
                url: "/AppointmentScheduling/GetScheduledAppointments",
                data: additionalData
            }

        },
        pageSize: 10,
        schema: { data: "data", total: "total" }
        }),
        pageable: true,
        sortable : true
    });   

 Can anyone has any idea how to achieve the same functionality through razor View, if so can you please give the controller sample code too.

Since it is in javaScript, there is no intellisense and hard to find out all the options that i can give it for a column. 
Rosen
Telerik team
 answered on 18 Feb 2013
1 answer
223 views
I have an edit view for a particular model.  The view contains the following Kendo autocomplete control code:

 @(Html.Kendo().AutoCompleteFor(model => model.Location).Placeholder("Please select a value")
               .Name("locationAutoComplete").BindTo((IEnumerable<LocationData>)ViewData["locationList"])
               .DataTextField("Name")) //Specifies which property of the Product to be used by the autocomplete.
               ;

The drop down auto complete is working.  However, existing values on the model (Location property) are not bound to the control.  When I open up an existing record in edit mode the autocomplete control is empty, even if the underlying Location property on the model has a value.  How does this control handle binding?
Daniel
Telerik team
 answered on 18 Feb 2013
10 answers
267 views
When using IE (tested in version 7-10) you must click on the first empty line for the editor to gain focus.  FireFox and Chrome do not exhibit this behavior with the Editor control.

Example:  While using Firefox or Chrome you can click anywhere inside the Editor box and it will gain focus (The mouse cursor changes to an I-Beam anywhere in the Editor window).  In Internet Explore you will only gain the I-Beam cursor when you are hovering over areas where text exists.

This behavior is easily replicated by dropping a default Editor control onto a page.  the behavior can been seen on the demo site even: http://demos.kendoui.com/web/editor/index.html
Dimo
Telerik team
 answered on 18 Feb 2013
1 answer
605 views
Kendo UI: MVC 2012.3.1114 Commercial
OS: Windows 7 64 bit
Browser: IE 9
JQuery: 1.8.2

When uploading a file with special characters (for example "&#170.xlsx") using the Upload control with "showFileList" option turned on, the special characters are processed. What would be desirable is to have the file list show the filename as the user sees it on their machine. It would make sense to see an apostrophe, but not see special HTML codes or JavaScript processed. This can be viewed by uploading a file with the name "&#170.xlsx" using the demo Upload control at http://demos.kendoui.com/web/upload/index.html. What can be done about this? Thanks.
Dimiter Madjarov
Telerik team
 answered on 18 Feb 2013
0 answers
90 views
Hello, let me state that I just started to use Telerik Kendo UI.
I'm creating a simple CRM to manage customers of our companies, using ASP.NET MVC, OpenAccess ORM and Kendo UI.

It will use mainly kendo grid to access and manipulate data from a SQL db.

I wish I had some advice from you experts: it is better to use standard controller and access the data via dbContext or work with API services (ODATA3 / ASP.NET API) and bind the grid to API result?

Thanks in advance for your answers,
Luca
Luca
Top achievements
Rank 1
 asked on 18 Feb 2013
5 answers
160 views
I have noticed an intermittent error with scrolling when using remote virtualization in IE 8.0.
Here are the steps to reproduce the error:

1) Sort the grid by a single column in ascending order
2) Drag the scroll bar down to the bottom of the grid as quickly as you can

In some cases the last few records are not the ones you would expect based on the sort.

This is also reproducable in your online demo. If you sort by Order ID ASC you will in some cases not see the number 11077 as the last entry in the grid.
Seems like the grid corrects itself if you scroll up from the bottom (just a tiny amount is needed).

Thanks
Tor
Daniel
Telerik team
 answered on 15 Feb 2013
7 answers
361 views
It would be great if Kendo team can add Scaffolding templates to MVC templates for CRUD operation using Kendo's controls.
Any play or thoughts on that?

Thanks!
..Ben
Sebastian
Telerik team
 answered on 15 Feb 2013
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?