Telerik Forums
UI for ASP.NET MVC Forum
1 answer
378 views
I would like to position the refresh button at the top of the grid. Is that possible? The grid below is a sample of the code. (mostly default values)

@(Html.Telerik().Grid(Model.DeleteableRules)

         
.Name("DeleteableRulesGrid")

         
.DataKeys(dk => dk.Add(dr => dr.ListID))

         
.Selectable()

         
.Columns(columns =>

          {

             
columns.Bound(dr => dr.ListID).HtmlAttributes(new
{ style = "width:100px;" });

             
columns.Bound(dr => dr.OrganizationID).HtmlAttributes(new { style = "width:100px;"
});

             
columns.Bound(dr => dr.RuleName).HtmlAttributes(new
{ style = "width:300px;" });

             
columns.Bound(dr => dr.CurrentState).HtmlAttributes(new
{ style = "width:300px;" });

          })

 

          )



Dimo
Telerik team
 answered on 08 Oct 2014
2 answers
246 views
Hello

I want to change the DateHeaderTemplate from the standard "ddd MM/dd" format to "ddd dd/MM". How do I do this in MVC?
I couldn't find an example for MVC in the docs, only for javascript.

BR
Jonas
Jonas
Top achievements
Rank 1
 answered on 08 Oct 2014
3 answers
439 views
I found help from http://docs.telerik.com/kendo-ui/api/javascript/ui/tooltip in getting this far.  However, we are using Kendo MVC Widgets so, the line of code
below "return target.text() is never populated.  I did find by poking around in debugger that e.target.context.value had the values for each generated <input> tag in both the Html.Kendo().TextBox() and Html.Kendo().ComboBox().

Here's the code that displays a Kendo Tooltip for every input html element within a specific div.

$(document).ready(function () {
        $("#project-tabs").kendoTooltip({
             filter: "input",
             content: function (e) {
                     var target = e.target; // the element for which the tooltip is shown
                     //return target.text(); // set the element text as content of the tooltip --> This does not work on MVC.
                     return e.target.context.value;  // This does work on MVC Widget
            }
    });
});

Is there a better way?
Petur Subev
Telerik team
 answered on 08 Oct 2014
1 answer
130 views
You surely are all aware of the T4MVC service, very helpful in avoid 'magic strings'.
Now, I would like to use it in a kendo template, but I found difficult to understand how parameters must be written.
Right now, I have this sample template:

<script id="agenda-event-template" type="text/x-kendo-template">
    <div>
        <a href='/Controller/Action?id=#: currentid#'>#: title #</a>
    </div>
</script>

(where I stripped out non relevant code).

If I want to use T4MVC, I have to rewrite the previous code as in:

<script id="agenda-event-template" type="text/x-kendo-template">
    <div>
        <a href='@MVC.Controller.Action(??????)>#: title #</a>
    </div>
</script>

But how can I pass the 'currentid' parameter in the action?
Thanks in advance...
Andrea

T. Tsonev
Telerik team
 answered on 08 Oct 2014
1 answer
382 views
If I use the standard kendo.common.min.cs stylesheet with the Report Viewer control, everything works fine. However, if I switch to the kendo.common-bootstrap.min.cs stylesheet, the toolbar is much taller and overlaps the top of the report:


I've tried this with a sample report project from another thread and it exhibits the same behaviour as my application. Is there something else I should do to get this to work? For now I'm going to use the non-bootstrap stylesheet as it doesn't seem to cause any other changes.
Alex Gyoshev
Telerik team
 answered on 07 Oct 2014
29 answers
3.3K+ views
Ok, it seems that there is a problem with the way that the MVC extensions render their javascript and I need some Admin input in order to resolve this going forward as it's causing massive issues.

With the lack of the script registrar, the MVC extensions appear to dump thier javascript in the middle of the body, immediately after the element being modified. The outputted javascript is wrapped in an auto-running function so that it executes immediately. Apart from dumping js into the middle of the page, which is by popular opinion considered a dubious practice, this causes problems with other javascript libraries that may then go in afterwards and manipulate the DOM. If such a library snips out the parent of an element in question which happens to contain the associated script tags and reinserts it, all of the javascript snippets run again, causing the Kendo controls to break (because they have been initialised twice) and everything to fail. If the Kendo scripts were at the end of the body this wouldn't be an issue.

Why isn't all javascript rendered at the end of the body? How can this be resolved?
Jacques
Top achievements
Rank 2
 answered on 07 Oct 2014
8 answers
284 views
Hi.

I'm using scheduler to make a workforce calendar for my department, there are approximately 100 people across three shifts.

I have everything working, however in day and month view, as you can imagine, the shifts are extremely narrow.

Is there a way to make the scheduler scroll able horizontally with the events as a fixed size so that they display properly?

I did a CSS style on k-event, and it did make the events wider, however now they overlap each other instead of scrolling out the schedule.
Abradax
Top achievements
Rank 1
 answered on 06 Oct 2014
6 answers
528 views
I can't seem to get nested templates to work.  Perhaps this isn't even supported?  I am seeing the following in console.  
Uncaught ReferenceError: BotName is not defined 
I believe this is related to the last file shown, _BotGrid.  This grid should display a link to the details page for the Bot, however, the ClientTemplate("#=BotName#") does not appear to be working.  My guess is the templating engine is looking for BotName to come from the parent grids model, and not from the Bot Grids model.  Is there a work around or a way to make this work?

Files

TopLevelGrid.cshtml
@model System.Collections.Generic.List<Subscriber>

@(Html.Kendo().Grid<Subscriber>()
    .Name(ViewData["Name"].ToString())
    .ClientDetailTemplateId("gridDetailsTemplate")
    .DataSource(dataSource =>
        dataSource
        .Ajax()
        .Sort(sortOrder => sortOrder.Add(s => s.Name).Ascending())
        .PageSize(20)
        .Read(
            read => read.Action("_Grid", "Subscribers", new { Area = "Admin" })
        )
    )
    .Columns(columns =>
    {
        columns
            .Bound(s => s.Name)
            .ClientTemplate("<a href=\"\\#/Detail/#=Id#\">#=Name#</a>")
            .Title("Subscriber")
            .Width("100%");
        columns
            .Bound(s => s.Active)
            .Filterable(false)
            .HeaderHtmlAttributes(new { style = "text-align:center; " })
            .HtmlAttributes(new { style = "text-align:center; " })
            .ClientTemplate("<input type=\"checkbox\" #=Active ? checked='checked' : '' # disabled=\"disabled\" />");
    })
    .Filterable()
    .Sortable()
    .Pageable()
)

@Html.Partial("_GridDetail")


_GridDetail.cshtml partial view -- This part seems to work fine if I remove the _BotGrid partial view
<script id="gridDetailsTemplate" type="text/kendo-tmpl">
    <ul id="subscriber-tabs-#=Id#" class="nav nav-tabs">
        <li class="active"><a href="\\#subscriber-bots-#=Id#" data-toggle="tab">Bots</a></li>
        <li class=""><a href="\\#subscriber-markets-#=Id#" data-toggle="tab">Markets</a></li>
        <li class=""><a href="\\#subscriber-report-scheduling-#=Id#" data-toggle="tab">Online Report Schedules</a></li>      
    </ul> 
    <div id="subscriber-tab-content-#=Id#" class="tab-content">
        <div class="tab-pane fade active in"  id="subscriber-bots-#=Id#"> 
            @Html.Partial("_BotGrid", new ViewDataDictionary { { "SubscriberID", "#=Id#" } })
        </div>
    </div>
</script>


_BotGrid.cshtml partial view
@(Html.Kendo().Grid<AMS.DTO.Bot>()
    .Name("Bots-" + ViewData["SubscriberID"].ToString())
    .DataSource(dataSource => dataSource
        .Ajax()
        .Sort(sortOrder => sortOrder.Add(b => b.BotName).Ascending())
        .Model(model => model.Field(m => m.BotName))
        .PageSize(20)
        .Read(
            read => read.Action("_BotGrid", "Subscribers", new { Area = "Admin", id = ViewData["SubscriberID"].ToString() })
        )
    )
    .Columns(columns =>
        {
            columns.Bound(b => b.BotName)
                .ClientTemplate("#=BotName#")
                .Title("Name");
            columns
                .Bound(b => b.CreateDate)
                .Filterable(false)
                .Format("{0:MM/dd/yyyy}")
                .Title("Created");
        }
    )
    .Sortable()
    .Pageable()
    .Filterable()
    .Scrollable(scrolling =>
        scrolling.Height(200)
    )     
    .ToClientTemplate()
)

Thanks!
Mike
Top achievements
Rank 1
 answered on 06 Oct 2014
0 answers
135 views
Dear Experts,

I am using the MVC2 WEB application .
I have downloaded dll from this site http://simple-telerik-extensions.googlecode.com/svn-history/r14/trunk/telerik/Binaries/Mvc2/

I am using the following code in my view
   <%
        Html.Telerik().ComboBox()
            .Name("MenuIDs")
            
        .Render();       

                 %>
i am getting following error please help me
 'Telerik.Web.Mvc.UI.ViewComponentFactory' does not contain a definition for
'ComboBox' and no extension method 'ComboBox' accepting a first argument of type
'Telerik.Web.Mvc.UI.ViewComponentFactory' could be found (are you missing a
using directive or an assembly reference?)



Hari
Top achievements
Rank 1
 asked on 06 Oct 2014
1 answer
491 views
I have a Grid that I want to use for adding information to a collection in the DataModel of my view.  How do I bind the Grid to my collection and then when it is passed back to the controller ensure that any CRUD changes made to grid are reflected in the DataModel?  Below is my Grid. 

01.@(Html.Kendo().Grid(Model.Charges)
02.      .Name("charges_grid")
03.      .Columns(columns =>
04.      {
05.          columns.Bound(charge => charge.Type)
06.              .Title("Charge Description");
07.          columns.Bound(charge => charge.Amount)
08.              .HtmlAttributes(new { @style = "text-align:right;" })
09.              .Width(100)
10.              .Title("Amount");
11.          columns.Command(command =>
12.          {
13.              command.Edit();
14.              command.Destroy();
15.          }).Width(175);
16.      })
17.      .BindTo(Model.Charges)
18.      .ToolBar(toolbar => toolbar.Create())
19.      .Editable(editable => editable.CreateAt(GridInsertRowPosition.Bottom))
20.      .DataSource(dataSource => dataSource
21.          .Ajax()
22.          .Model(model => model.Id(p => p.Type))
23.          .ServerOperation(false)
24.          .Create(update => update.Action("Create", "Home"))
25.          .Read(read => read.Action("Read", "Home"))
26.          .Update(update => update.Action("Update", "Home"))
27.          .Destroy(update => update.Action("Destroy", "Home"))
28.      ))

This is part of a larger view where I am capturing the data for my model, but I can not get my grid to populate with contents of my collection on load or my model to contain updated or new items upon return to the controller.  Below is a sample of my model.

01.public class Shipment
02.{
03.   // other data members
04.    public string Signed { get; set; }
05.    public string BundleId { get; set; }
06.    public float TotalAmountDue { get; set; }
07. 
08.    public ICollection<Charge> Charges { get; set; }
09.}

Petur Subev
Telerik team
 answered on 06 Oct 2014
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
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
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
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?