Telerik Forums
UI for ASP.NET MVC Forum
2 answers
240 views

Hi,

Is there a way to access scheduler resources inside the Event Template?

For instance:

Course Resource - List of courses with CourseID and CourseTitle.

Event Template - 

.EventTemplate(
        "<div style=color:#:setTextColor(data)#>" +
        "<h4>Course: #= CourseTitle # </h4>" +     
        "<h5>Class: #= title # </h5>" +
        "</div>"
    )

"<h4>Course: #= CourseTitle # </h4>"  would be returned by the foreign key ID from the viewModel record to the Course Resource primary key.

Chris
Top achievements
Rank 1
 answered on 13 May 2016
3 answers
484 views

I'm currently working on a .NET MVC app with one area, Inside, and then a single controller on the root area, Home.  What I'm noticing is something somewhat similar to what is discussed in this post; I have a Home controller in both my root and Inside areas, and when the menu attempts to render the links to the root actions while at an Inside url, such as /Inside/Account/Login, the links to any Home actions which are present in both the Inside and root areas are not rendered.  I noticed that if I take away the [Authorize] attribute on my Inside Home controller, the actions do render properly i.e. /Home/Index is rendered.  However, I want to make sure that my inside controllers are decorated with the Authorize attribute.

 

For example, with the following code snippet

// Root Home Controller
public class HomeController : Controller {
    // Doesn't render
    public ActionResult Index() { return View(); }
    // Doesn't render
    public ActionResult Contact() { return View(); }
    // Renders
    public ActionResult About() { return View(); }
}
 
// Inside Home controller
[Authorize]
public class Home : Controller {
    public ActionResult Index() { return View(); }
    public ActionResult About() { return View(); }
}
 
// /Inside/Account/Login View snippet
@(Html.Kendo().Menu().Name("MainMenu").Items(children =>
{
    items.Add().Text("Root Home").Action("Index", "Home", new { area = "" });
    items.Add().Text("Root Contact").Action("Contact", "Home", new { area = "" });
    items.Add().Text("Root About").Action("About", "Home", new { area = "" });
    items.Add().Text("Login").Action("Account", "Login", new { area = "Inside" });
}))

if I go to /Home/Index or /Home/Contact I get a menu the menu you would expect (as seen in Correct.png), whereas if I go to /Inside/Account/Login, I get a menu with only the About and Login buttons (as seen in Incorrect.png).  My guess is that the Telerik Menu rendering function is attempting to security trim [Authorize] decorated action links with identical names disregarding the area in which the action was specified.

I'm wondering if there is a better way around this bug than to decorate my Inside.Home.Index/Contact actions with [AllowAnonymous] and using a redirect to the root area if a user is not authenticated.

 

 

T. Tsonev
Telerik team
 answered on 13 May 2016
11 answers
680 views

Hi,

 

I am using MVC data annotation in the class (sample below) everything works ok but I am facing two issues
1. The class doesn't turn to "k-invalid" after submit click for the kendo comboboxm, therefore, I cannot set the css as red
2. The conbobox tooltip is behind another control, tooltip doesn't expand it like textbox

[Required(ErrorMessage = "Car Owner is required.")]
[Range(1, int.MaxValue, ErrorMessage = "This is invalid.")]
public int? CarOwnerId { get; set; }

Thank you!

Ianko
Telerik team
 answered on 13 May 2016
3 answers
297 views

I have created an MVC ASP.NET 5 Web API project  which uses DNX 4.5.1

I am trying to create a gantt chart in my .cshtml view file via the following code:

<div id="gantt">
    @(Html.Kendo().Gantt<GanttData, DependencyViewModel>()
                .Name("Gantt")
                .DataSource(ds => ds
                    .Read(read => read
                        .Action("Tasks", "Home")
                    )
                    .Model(m =>
                    {
                        m.Id(f => f.TaskID);
                        m.ParentId(f => f.ParentID);
                        m.OrderId(f => f.OrderId);
                        m.Field(f => f.Expanded).DefaultValue(true);
                    })
                )
                .DependenciesDataSource(ds => ds
                    .Read(read => read
                        .Action("Dependencies", "Home")
                    )
                    .Model(m =>
                    {
                        m.Id(f => f.DependencyID);
                        m.PredecessorId(f => f.PredecessorID);
                        m.SuccessorId(f => f.SuccessorID);
                        m.Type(f => f.Type);
                    })
                ).Resizable(true)
    )
</div>

The error comes from IHtmlHelper "not containing a definition" for Kendo even though Kendo.Mvc is in my project's references. 

This identical code successfully generates a gantt chart in a ASP.NET 4.5.1 MVC 4 project, however.

Is there a way to create a Gantt chart in an ASP.NET 5 MVC application?

 

Thanks

 

Bozhidar
Telerik team
 answered on 13 May 2016
4 answers
103 views
Hello, I am trying to generate a header with the grid title at the top of my grid along with a close "x" button in the top right corner. Is this possible? 
Scott
Top achievements
Rank 1
 answered on 12 May 2016
5 answers
1.0K+ views

Am I missing something?  I cannot get this control to work at all. I first tried making a simple switch:

@Html.Kendo().MobileSwitch().Name("​MySwitch").Checked(true).OnLabel("Label On").OffLabel("Lable Off")

All I get is a check box. So then I tried the  sample on the demo site, and that also did not work.

 I am using MVC4 on VS 2015 and I used the "Configure Project" wizard to add "Asp.Net MVC" to the project.

 

Chris
Top achievements
Rank 1
 answered on 12 May 2016
1 answer
783 views

Hello,

I need collapse the rest of de expanded rows when the user expand a new row and scroll this row to the top position of the grid. I have tried with the next code unsuccessfully.

 

Html.Kendo().Grid<ProductorViewModel>().Name("productors")

    ......

.Events(e => e
            .DataBound("onDataBound")
            .DetailInit("onDetailInit")
            .DetailExpand("onExpand")
        )

.....

 

<script type="text/javascript">

        function onExpand(e) {
            var grid = $("#productors").data("kendoGrid");
            var dataView = this.dataSource.view();
            var model = e.data;
            for (var i = 0; i < dataView.length; i++) {
                var uid = dataView[i].uid;
                if (uid != model.uid) {
                    var tr = $("tr[data-uid=" + uid + "]");
                    grid.collapseRow(tr);
                }
            }
        }

</script>

 

Can you help me with some example?

Thanks!

Maria Ilieva
Telerik team
 answered on 12 May 2016
3 answers
412 views
How to get the grid's rows count ?My grid has data,but the code shows 0 row..
alert($('#Grid').data("kendoGrid").tbody.find('>tr.k-master-row').length);
Dimiter Madjarov
Telerik team
 answered on 12 May 2016
1 answer
167 views

Hi,

One of my grid .update  and .create action take a long time because he really has to do a lot of work in the background.

How can I force people to not pressing the update button more then ones?

Is it possible to disable the update button directly after the first time people click on it?

Thanks in advance

Maurice Lucas

Marin
Telerik team
 answered on 12 May 2016
1 answer
93 views

I have a spreadsheet with a date column based on a smalldatetime field in a SQL table.

The spreadsheet loads correctly and the column is displayed in date format but when I try to edit the date (before saving) I receive an error in

kendo.all.min.js stating that Object doesn't support property or method 'indexOf'

I have upgraded the project to the Q2 2016 release and still have the same issue.

Any help would be appreciated.

Alex Gyoshev
Telerik team
 answered on 12 May 2016
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
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
DateTimePicker
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?