Telerik Forums
UI for ASP.NET MVC Forum
6 answers
412 views
Hi,

I'm having this problem that only happens in a particular situation. If I have a grid with only one row and I try to delete it, there is a javascript error here.

l._current.closest("table")[0].focus()
Unhandled exception at line 16, column 31418 in http://localhost/zzz/Scripts/kendo/2012.3.1114/kendo.web.min.js
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'closest': object is null or undefined

When there is more than one row on the grid, deletes work perfectly fine. I believe it might have to do with the grid trying to set focus to the closest row available...when there are no rows available at all. This is what I'm using to generate the grid. Thanks in advance.

@(Html.Kendo().Grid<MyNamespace.MyModel>()
      .Name("myGrid")
      .Columns(columns =>
      {
          columns.Bound(c => c.Name);
          columns.Command(c =>
          {
c.Edit();
               c.Destroy();           });       })       .ToolBar(toolbar => {             toolbar.Create();             })       .Sortable()       .Selectable()       .Reorderable(r => r.Columns(true))       .Resizable(r => r.Columns(true))       .Navigatable()       .Filterable()       .Scrollable(scroll => scroll.Height(500))       .Editable(editable => editable.Mode(GridEditMode.InLine))       .DataSource(dataSource => dataSource         .Ajax()         .Read(read => read                     .Type(HttpVerbs.Get)                     .Url(Url.RouteUrl("DefaultApi"new { httproute = "", controller = "mycontroller" }))              )         .Create(create => create                     .Type(HttpVerbs.Post)                     .Url(Url.RouteUrl("DefaultApi"new { httproute = "", controller = "mycontroller" }))              )         .Update(update => update                     .Type(HttpVerbs.Put)                     .Url(Url.RouteUrl("DefaultApi"new { httproute = "", controller = "mycontroller" }))              )         .Destroy(destroy => destroy                     .Type(HttpVerbs.Delete)                     .Url(Url.RouteUrl("DefaultApi"new { httproute = "", controller = "mycontroller" }))              )         .Model(m => {                     m.Id(c => c.Id);                     }                )         .ServerOperation(false)) )

UPDATE: Since it was apparently just trying to find a row to focus, I added a check to see if the object was null. I wrapped
the call like this.
function(){if(l._current)l._current.closest("table")[0].focus();}

Seems to be working now for both a single row on the grid or multiple rows. Hope this gets fixed in a future release.
OmarOrnelas
Top achievements
Rank 1
 answered on 15 Jan 2013
1 answer
477 views
I want to show progress bar or disable save button in the toolbar while batch update. How do I do that ?
I am using KendoUI MVC grid.
Vladimir Iliev
Telerik team
 answered on 15 Jan 2013
2 answers
153 views
I have a telerik grid on a page with a custom Edit button for each row.  On click of the Edit button a Telerik Window opens which contains a partial view.  When I run it looks like this (the window opens to full size - size specified when created client side - and all content is visible):



However another user gets this (the modal is shrunk down so that all content is not visible and seems to be forced to fit within the width of the body set on the parent page).  I've enabled scrolling on the modal and the user doesn't see scrollbars and it still looks like below):



We're using the same browser (IE 9) and same resolution.  What could cause the Telerik window to shrink?
Dimo
Telerik team
 answered on 15 Jan 2013
2 answers
224 views
Hello,

is it possible to "select" the node which is currently selected? Right now the select-event doesn't trigger if the node is already selected. I need it to be triggered each time the user clicks on a node.

Thanks!
BigzampanoXXl
Top achievements
Rank 1
 answered on 15 Jan 2013
1 answer
182 views
When I view the Kendo Grid in Compatibility mode, if a cell is blank, there are grid lines missing - from the grid.  Is there a way to fix this?

Dimo
Telerik team
 answered on 14 Jan 2013
1 answer
120 views
Hi

in my ASP .NET MVC application I need to insert images inside the x-axis labels of a Bar Chart. Is it possible? If possible could you please share how to implement.

Thanks
Murthy
Hristo Germanov
Telerik team
 answered on 14 Jan 2013
1 answer
1.6K+ views
Hi,

first of all, this is how I implemented the NumericTextBox, bound to an integer:
@(Html.Kendo().NumericTextBoxFor(m => m.Number)
.Name("ntb")
.Format("n0")
.Min(1)
.Max(50)
)

My problem is:
As soon as I bind something against the NumericTextBox (when I use NumericTextBoxFor(...)), the value is never empty. It looks empty but as soon as the user clicks inside the TextBox the value of the bound integer (int.MinValue or whatever value the property has) is shown. First of all - the value (int.MinValue) makes no sense because the Min-property is set to 1. Secondly, why is there anything? The NumericTextBox should be empty, because I didn't set a value.

This problem causes, that the user has to delete the value first before he is able to insert something. On initialisation of the NumericTextBox it should be empty - but it should also be bound to a property.

Is there any workaround or solution for this problem? Hope someone can help me.
Daniel
Telerik team
 answered on 14 Jan 2013
1 answer
467 views

Hi, I've been looking at this for sometime and I've even tried a few example that apparently work but they don't for me.  All I want to do is say if ErrorCount > 0 then add a link similar to the WarningCount.  Just to get the basics up and running and following an example I simply want to say if ErrorCount > 0 then show 'Yes' otherwise show 'No'. For some reason it seems to ignore the ClientTemplate and just show the ErrorCount value.  Any ideas?? Please see the code below;

Many thanks.

Steve
@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .HtmlAttributes(new { style = "height: 500px" })
    .Columns(columns =>
    {
        columns.Bound(p => p.ImportTypeName);
        columns.Bound(p => p.ImportedRecordCount);
        columns.Bound(p => p.FeedRecordCount);
        columns.Bound(p => p.ErrorCount).ClientTemplate("# if (ErrorCount > 0) { #" + "Yes" +
                "# } else { #" + "No" + "#}#");
 
        columns.Bound(p => p.WarningCount).Template(
       
 
  @<text>
<a href="@Url.Content("~/client/view/warnings/" + @item.ImportTypeID)">@item.WarningCount</a>
</text>);
 
 
        columns.Bound(p => p.CompletedOn);
 
    })
    .Sortable()
    .Scrollable()
    .Filterable()
 
)
Rosen
Telerik team
 answered on 14 Jan 2013
1 answer
183 views

I have a chart that is pulling data from a web service.  That data has Dates in it, and if I use that date object as a label, the chart think's it's in GMT time and then changes the hours to match the local time.  In my case, I'm in Central Time Zone, so it's 6 hours off from GMT, so it subtracts 6 hours from the ReadingDate and displays it as 6 hours off.  Is there any way to stop the label formatting from changing the datetime?

  $("#ChartContents").kendoChart({
    theme: $(document).data("kendoSkin") || "default",
    dataSource: App.ChartDataSource,
    title: { text: "Energy Usage In Days", visible: false },
    seriesDefaults: { type: "line" },
    series:
    [
      { type: "line", field: "kWh", name: App.CurrentDeviceName, axis: "WattAxis", color: "#FF9900" },
      { type: "line", field: "kWh2", name: App.CurrentDeviceName2, axis: "WattAxis", color: "#339900" },
    ],
    categoryAxis: {
      labels: { rotation: -90, dateFormats: { minutes: "HH:mm", hours: "HH:mm", days: "ddd, MMM d", months: "MMM yyyy", years: "yyyy" } },
      type: "Date",
      field: "ReadingDate",
      baseUnit: App.DayChartBaseUnit,
      majorGridLines: { visible: false }
    },
    valueAxis: [{ name: "WattAxis", title: { text: "kWh" }, min: 0, color: "#FF9900" }],
    tooltip: { visible: true, format: "{0:N0}", template: "Date: #= dataItem.DisplayDate # <br />kWh 1: #= dataItem.kWh # <br />kWh 2: #= dataItem.kWh2 #" },
    legend: { position: "bottom" }
  });


Hristo Germanov
Telerik team
 answered on 11 Jan 2013
1 answer
110 views
Hi All,

I was trying out the window component but it didn't work when I tried to open it from javascript:
$("#Window").data("kendoWindow").open();

I found out I had to update my jQuery to 1.8.x in order for it to work, and it did. But then another problem arose, my grid component has now shrunk. The DIV containing the grid still has the correct height but the k-grid-content DIV now has fixed height of 25px. The problem dissapears when I don't use .Scrollable(). Does anyone have the same issue or can explain to me what I have to do?

I'm using jQuery 1.8.2 and Kendo version 2012.3.1114. (Before the jQuery update I was using jQuery 1.7.1).

Thanks in advance!

Lennart


Vladimir Iliev
Telerik team
 answered on 11 Jan 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
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?