Telerik Forums
UI for ASP.NET MVC Forum
4 answers
1.8K+ views

Hello all, 

 I'm evaluationg the controls for my application and I'm currently stuck in something really stupid.  I'm using the Kendo Textbox helper and added the required attribute like this:

 

@(Html.Kendo().TextBox()
         .Name("LastName01")
         .HtmlAttributes(new { placeholder = "Apellido Paterno", required = "required", validationmessage = "Enter {0}", @class = "col-sm-2 form-control" })
            )
<span data-for='LastName01' class='k-invalid-msg'></span>

 

But the position of the valition message is off, how can I get it under the textbox?  Attached is the screen shot.

Plamen Lazarov
Telerik team
 answered on 15 Sep 2015
3 answers
841 views

 Hi,

 I'm trying to set the autofocus on my edit screens. If it's an Kendo-control that I want to have autofocus, it doesn't seem to work.

 I tried setting the HtmlAttributes for de dropdownlist:

<div class="form-group">
    @Html.LabelFor(model => model.IdLocation, htmlAttributes: new { @class = "control-label col-sm-2" })
    <div class="col-md-10">
        @(Html.Kendo().DropDownListFor(model => model.IdLocation)
              .DataTextField("Value")
              .DataValueField("Key")
              .OptionLabel("Selecteer... ")
              .HtmlAttributes(new { autofocus = "" })
              .DataSource(source => source.Read(read => read.Action("GetAllItemsAsDictionary", "Location")))
        )
    </div>
</div>​

As a result I see an input element generated with the attribute autofocus set, but also with style 'display: none'.

<div class="col-md-10">
  <span aria-activedescendant="d012aecf-c5cf-41cd-b307-85b7dfad7807" aria-busy="false" aria-readonly="false" aria-disabled="false" aria-owns="IdLocation_listbox" tabindex="0" aria-expanded="false" aria-haspopup="true" role="listbox" unselectable="on" class="k-widget k-dropdown k-header" title="" style="">

    <span unselectable="on" class="k-dropdown-wrap k-state-default">

      <span unselectable="on" class="k-input">12a (Riek)</span>

      <span unselectable="on" class="k-select">

        <span unselectable="on" class="k-icon k-i-arrow-s">select</span>

      </span>

    </span>

    <input style="display: none;" data-role="dropdownlist" autofocus="" data-val="true" data-val-number="The field Locatie must be a number." data-val-required="The Locatie field is required." id="IdLocation" name="IdLocation" value="1" type="text">

  </span>

  <script>
    jQuery(function(){jQuery("#IdLocation").kendoDropDownList({"dataSource":{"transport":{"read":{"url":"/events/Location/GetAllItemsAsDictionary"},"prefix":""},"schema":{"errors":"Errors"}},"dataTextField":"Value","dataValueField":"Key","optionLabel":"Selecteer... "});});
  </script>
</div>​

So my question is how to make a Kendo dropdownlist having autofocus?

Thank you for a reply.

Georgi Krustev
Telerik team
 answered on 15 Sep 2015
7 answers
318 views

Hi All,

 

I'm currently in a trial period for the MVC UI suite, and i'm currently configuring the pivot grid to fit our current project.

 

Now just currently going through the features of this pivot grid i realise that the AJAX pivot grid has far more functionality than the MVC one.

 

One function in particular i would like for the MVC pivot grid is the AJAX pivot grid field list functionality, as seen here.

 

Now is this possible? And if so is there any examples of this.

 

Thanks,

 

Jamie

 

Georgi Krustev
Telerik team
 answered on 15 Sep 2015
23 answers
559 views
At my organization, we have attempted to upgrade an asp.net MVC solution in Visual Studio 2013 using the Solution Upgrade Wizard from v2014.1.318.545 to v2014.1.528.545 on two different machines without success. 

The wizard manages to remove old content and scripts and add 400+ files, but a crash always occurs before it completes the process.  The crash causes the environment to restart, and the upgrade is very obviously incomplete.

Is this an issue that has been reported by anyone else?  Is there an alternative way to update our project instead of using the upgrade wizard?  Thanks!
Ventsi
Telerik team
 answered on 15 Sep 2015
1 answer
97 views

I've got data that looks like this from a DB:

FromSomething    ToSomething    Amount

place a                   place b             1.55

place d                   place b              2.33

place a                   place f               1.20

and so on .....

I need it to go in a matrix that looks like this:

                  place b           place f       place m

place a       1.33               1.25          .50

place b        0                   1.00          .25

 

I can't get this to work at all, using the pivot grid and configuring it like the Telerik demos site, using local binding.  The grid is blank.

Is the pivot grid right for this?  If so, how should it work?

Georgi Krustev
Telerik team
 answered on 15 Sep 2015
1 answer
187 views

What is the recurrenceId field for in the scheduler and if it is important why or why is it not part of the ISchedulerEvent interface that is required for the scheduler view model???????????????????

What exactly is going on with this product?

Vladimir Iliev
Telerik team
 answered on 15 Sep 2015
1 answer
1.2K+ views

Hi,

I am having problems getting the total count field from JSON odata using the Html Helper for the Kendo Grid. Getting the odata.count value using JavaScript is fine though but our preference is to use the MVC html helper. The following is both examples:

 

Using MVC Html Helper produces the following JavaScript error: Uncaught TypeError: Cannot read property 'count' of undefined. See the Schema property for where we are trying to get the oData.count.

@(Html.Kendo().Grid<DataObject>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(e => e.Field1).Filterable(false);
        columns.Bound(e => e.Field2);
        columns.Bound(e => e.Field3);
    })
    .DataSource(dataSource => dataSource
        .Custom()
        .Type("odata")
        .Schema(schema =>
        {
            schema.Data("value")
                 .Total("odata.count");
        })
        .Transport(transport =>
        {
            transport.Read(read => read.Url("/odata/DataUrl).DataType("json"));
        }
        )
        .PageSize(5)
        .ServerPaging(true)
        .ServerSorting(true)
        .ServerFiltering(true)
    )
    .Pageable()
    .Sortable()
    .Filterable()
)


Using the following JavaScript works:

$(".grid").kendoGrid({
            dataSource: {
                type: "odata",
                transport: {
                    read: {
                        url: "/odata/DataUrl",
                        dataType: "json"
                    }
                },
                schema: {
                    data: function(data) {
return data['value'];
                    },
                    total: function(data) {
                        return data['odata.count'];
                    },
                    model: {
                        fields: {
                            Field1: { type: "date" },
                            Field2: { type: "string" },
                            Field3: { type: "string" },
                        }
                    }
                },
                pageSize: 20,
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            },
            filterable: true,
            sortable: true,
            pageable: true,
            columns: [
                {
                    field: "Field1",
                    filterable: false,
                    format: "{0:MMM dd, yyyy}"
                },
                {
                    field: "Field2",
                    filterable: false
                },
                {
                    field: "Field3",
                    filterable: false
                }
            ]
        });



JSON

{
  "odata.metadata":"http://localhost:15649/odata/$metadata#​DataUrl","odata.count":"100","value":[
    {
      "​Field1":"2015-07-21T11:45:38.927"
      ,"​Field2":"2015-07-21T11:33:41.067"
      ,"​Field3":"2015-07-21T11:45:35.993"
    }
    ...
  ]}

 

Looking in the documentation there are only examples of this using javascript, are there some examples using the html helpers as well somewhere? Any pointers in the right direction are welcome.

thanks,

Rob

Alexander Popov
Telerik team
 answered on 15 Sep 2015
1 answer
71 views

Hi,

I did search for your private bower repositories. The UG link is broken from your site.

 http://docs.telerik.com/kendo-ui/install/bower#install-kendo-ui-professional-bower-package

 404 - File or directory not found.​​

 Also the same for this below page too.

http://docs.telerik.com/KENDO-UI/install/custom#cdn​

Petyo
Telerik team
 answered on 15 Sep 2015
1 answer
477 views

Hi,

we try to update with the VS Extension by clicking "Upgrade Wizard" from our current 2015.2.805.545 Dev Version to the newest 902 version.

After a few minutes Visual Sutdio freezes on "Copy Globalization files" from Telerik.
I try to wait the whole night, checked for this this morning but no change.

 

Any ideas?

Yana
Telerik team
 answered on 14 Sep 2015
5 answers
404 views

I working with the telerik grid a since a few weeks.

It seems that the Bound() Method of the MVC Grid ignores the Type when I write Bound(type, name).

When I have a model binded grid, it works perfectly:

    @(Html.Kendo().Grid<Web.Models.Consumption.PDCAModel.PDCAActionplanModel>()
                            .Name("PDCAActionplanGrid")
                            .NoRecords(@ResourcesLocal.Resources_Energy_PDCA.NoActionplanAvailable)
                            .Columns(col =>
                            {
                                col.Bound(x => x.PlanCreatedAt).Title(ResourcesLocal.Resources_Energy_PDCA.PlanCreatedAt).Width(200).Format("{0:dd.MM.yyyy}");
                                col.Bound(x => x.PlanstringTranslated).Title(ResourcesLocal.Resources_Energy_PDCA.Planstring);

                            })
                            .Events(e => e.DataBound("PDCAActionplanGrid_DataBound"))
                            .ClientDetailTemplateId("template")
                            .DataSource(ds => ds
                                .Ajax()
                                .Read(read => read.Action("DataSourcePDCAActionplanGrid", "Consumption"))
                                )

                        )

Here my column "PlanCreatedAt" is a datetime which will be shown perfectly.

Now I want to use a dynmic binded grid with a DataTable as DataSource:

     @(Html.Kendo().Grid<dynamic>()
            .Name("CompilationLogicGrid")
            .NoRecords()
            .Columns(col =>
            {
                col.Bound(typeof(DateTime), "Date").Filterable(false).Title(ResourcesGlobal.GlobalResources.Datum).Format("0:dd.MM.yyyy");

            })
            .Filterable(filtering => filtering.Enabled(true))
            .Sortable()
            .DataSource(dataSource => dataSource.Ajax()
                    .Read(read => read.Action("DataSource_CompilationLogicGrid", "Consumption"))
                    .Sort(x => x.Add("Date").Descending()))
        )

There it seems, that the binding will completly ignored. The output is either a plain string which I wrote in the format 0:dd.MM.yyyy or a  the plain output of the json response

The JSON Response is on both grids exactly the same: /Date(xxxxxxxxxx)/

Viktor Tachev
Telerik team
 answered on 14 Sep 2015
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?