Telerik Forums
UI for ASP.NET MVC Forum
1 answer
267 views
Hi,
I have the following dropdown lists declared in my view:

                <p>
                    <label for="ApplicationName">Application:</label>
                    @(Html.Kendo().DropDownList().Name("ApplicationNames")
                                                .BindTo(new SelectList(ViewBag.Applications)))
                </p>
                <p>
                    <label for="Roles">Roles:</label>
                    @(Html.Kendo().DropDownList().Name("Roles")
                                                   .DataSource(source =>
                                                   {
                                                       source.Read(read =>
                                                       {
                                                           read.Action("GetRoles", "Membership")
                                                                 .Data("filterRoles").Type(HttpVerbs.Post) ;
                                                       })
                                                       .ServerFiltering(true);
                                                   })
                                                       .Enable(false)
                                                      .AutoBind(false)
                                                      .CascadeFrom("ApplicationNames"))
                                                <script>
                                                    function filterRoles() {
                                                        return {
                                                            ApplicationNames: $("#ApplicationNames").val()
                                                        };
                                                    }
                                                </script>
                </p>


and my controller action :

    public class MembershipController : Controller
    {
        MembershipModel model = new MembershipModel();

        [HttpPost]
        public JsonResult GetRoles(string ApplicationNames)
        {
            List<String> roles = model.GetRolesForApplication(ApplicationNames);
           return Json(roles);
        }

but my GetRoles action never fires. Any ideas ?
Georgi Krustev
Telerik team
 answered on 05 Dec 2012
2 answers
619 views
I have a custom command button in a Client template that I want to fire a specific action.  I only want to fire the action. I do not want to redirect/render another View.  This is being done inside of a grid hierarchy.  Also, the action needs access to my model. Code for the template is below

<script id="myTemplate" type="text/kendo-tmpl">
<%: Html.Kendo().Grid<MyModel>()
     .Name("ThisGrid")
     .Columns(columns =>
     {
        columns.Bound(n => n.value)
                      .Title("Col1")
                      .Width(100);
        columns.Bound(n => n.IsEnabled)
                      .Width(100)
                      .ClientTemplate(
                          "# if (IsEnabled) { #" +
                               "Yes" + "#} else {#" +
                               "No" + "#}#");
        columns.Command(command => command.Custom(
                 "# if(IsEnabled) { #" +
                      "Disable" +
                      "#} else { #" +
                      "Enable" +
                      "#}#").Click("updateModel")).Width(40);
     })
     .DataSource(dataSource => dataSource
              .Ajax()
              .Read(read => read.Action(
                       "Binding_Model", "MyController")))
             .Pageable()
             .Sortable()
             .ToClientTemplate()
%>
Shannon
Top achievements
Rank 1
 answered on 04 Dec 2012
3 answers
419 views
Hi there, 

I am currently editing my grid not using the Kendo editor. I send the grid cell to my editor and refresh the grid after edition is complete. 
What I am trying to do is to keep the edited line highlighted using dataBound(). But because of the asynchronous load of data, the dataBound function is executed before my grid is fully loaded. 

Here is the used code, I really cannot figure out why the dataBound function is executed before data are loaded. 

var kendoDefaultParams = {
     // removed for clarity
    dataBound: onDataBound,
     // removed for clarity
};
 
$("#grid").kendoGrid(kendoDefaultParams);
 
function onDataBound() {
    gva.reSelectElements();
};
 
 
reSelectElements = function () {
    // gva.selectedVms() contains the previous selected elements
    if (gva.selectedVms().length == 0 || gva.selectedVms() == null || gva.selectedVms() == undefined) { return; }
    var id = gva.selectedVms()[0].uid;
    var grid = $("#grid").data("kendoGrid");
    var row = grid.table.find("tr[data-uid=\"" + id + "\"]");
    grid.select(row);
};

Am I doing something wrong ?? 
Daniel
Telerik team
 answered on 03 Dec 2012
1 answer
805 views
Hi,

We are facing an issue with assignment of content of the kendo window from a javascript. The content to be assigned is a url, which links to an action in a controller and this action method returns a partial view, which is to be shown in the window.

We are opening the window ,while clicking on the toolbar create button on the grid. Gird binding is given as follows and after that the declaration of the window is also given

@(Html.Kendo().Grid(Model.Posts)
                    .Name("Grid").Selectable()
                        .ToolBar(toolbar => toolbar.Template(
                            @<text>
                                <a class="k-button k-button-icon k-grid-add" href="#" onclick="AddNewPost(@Model.ClientId)" title="Add New Post">
                                <span class="k-icon k-add"></span>
                                </a>
                            </text>))

                                                .Columns(columns =>
                                                {
                                                    columns.Bound(p => p.poPostId).Hidden();
                                                    columns.Bound(p => p.poTitle).Title("Post Title").Width(390);
                                                    columns.Bound(p => p.poCreateTime).Format("{0:MM/dd/yyyy hh:mm:ss tt}").Title("Created").Width(180);
                                                    columns.Bound(p => p.poUpdateTime).Format("{0:MM/dd/yyyy hh:mm:ss tt}").Title("Last Updated").Width(200);
                                                    
                                                })
                                                .Pageable(pager => pager.PageSizes(true))
                                                .DataSource(dataSource => dataSource.Ajax()
                                                                                    .ServerOperation(false)
                                                                                    .Read(read => read.Action("GetMessages", "Home", new { area = "Post", id = Model.ClientId }))
                                                                                    .Model(model => model.Id(p => p.poPostId))
                                                                                    .PageSize(20)
                                                ).Sortable()
                                                            )    
                   
                        <script type="text/x-kendo-template" id="toobarTemplate">
                       
                        </script>    
                      

                    @(Html.Kendo().Window()
                            .Name("window")
                            //.Buttons(buttons => buttons.Close())
                    .Draggable(true)
                    .Visible(false)
                    .Modal(true)
                    .Title("Post")
                    .Width(850)
                    .Height(400))

The above given window is opened when the add button on the grid's toolbar is clicked. The java script to open the popup is given below.

function AddNewPost(clientid) {
    OpenPostAddEditWindow("Add New Post",0, clientid);
}

function OpenPostAddEditWindow(title, id, clientId) {   
   var window = $("#window").data("kendoWindow");
   window.content({ url: "/Post/Manage/Edit",
       data: { id: 0, clientId: -1112}
   });     
 
   window.title("New Post");
    debugger;
    alert(window.content());
    window.center();
    window.open();
}

when we were using telerik window, the code we used is as given below:

function OpenPostAddEditWindow(title, id,clientId) {
    var url = $.Site.RelativeWebRoot + "Post/Manage/Edit?id=" + id + "&clientId=" + clientId;
    var windowElement = $.telerik.window.create({
        Name: "PostWindow",
        title: title,
        html: '',
        contentUrl: url,
        modal: true,
        resizable: false,
        width: 850,
        height: 400,
        draggable: true,
        onClose: function (e) {
            e.preventDefault();
            windowElement.destroy();
        },
        onRefresh: function (e) {
            windowElement.center();
        }
    }).data('tWindow');
    windowElement.center().open();

}

how can we make it work same as telerik window and how to call an action in the controller given in the url.Please review this and send us the feedback as early as possible.

Thanks
Nirmala
Daniel
Telerik team
 answered on 03 Dec 2012
1 answer
262 views
avatar
I want to set the  width of a currency text box.  I am using the legacy WebBlue theme.

I have tried
<%: Html.Kendo().CurrencyTextBoxFor(x => x.Charged).HtmlAttributes(new { style = "width:100px" }) %>

but that just cuts off the right hand edge.

I have tried the approach in
http://www.kendoui.com/forums/mvc/numeric-textbox/set-width-on-client-side.aspx
 but that doesn't work either.
Vladimir Iliev
Telerik team
 answered on 03 Dec 2012
3 answers
198 views
I'm trying to retrieve the begin and end dates of the current calendar, but I can't determine the property or method.  I'm using JQuery and am able to retrieve the current month using

$(

 

"#myCalendar").kendoCalendar().data("kendoCalendar")._current.getMonth()

 

Any help would be greatly appreciated!
Georgi Krustev
Telerik team
 answered on 03 Dec 2012
1 answer
75 views
The documentation might need to be updated for the KendoUI and MVC helpers..

The online docs here:  http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/upload/metadata

Talk about binding client side events to the KendoUI MVC helpers.
using .ClientEvents()

After intellisense complaining and digging into it more I realized that its actually .Events() with a slightly different signature. 

Please keep the online documentation up to date with the releases.   thanks!

For reference I am using the 2012.3.1114.340 release.
T. Tsonev
Telerik team
 answered on 03 Dec 2012
3 answers
178 views
hello,

i'm looking to render a Barcode like 

<telerik:radbarcode runat="server" Height="112px" ShowChecksum="False" ShowText="False" Text="DccPGDqsRRMA" Type="Code128A" Width="463px"></telerik:radbarcode>

is there a way to use the radbarcode in the razor engine?

using MVC 4 with Kendo complete for MVVC

Thanks 

Atanas Korchev
Telerik team
 answered on 03 Dec 2012
1 answer
112 views
Hello,

I would like to know if there is a reason for window.kendo.jquery being passed to functions instead of jquery.

This happens in the kendo.all.js file since Q3 2012.

Thank you.
Atanas Korchev
Telerik team
 answered on 30 Nov 2012
3 answers
1.8K+ views
I've enabled editing in the grid via the Popup mode. Is there a way to hide specific fields in my popup window?

I would like to hide my ID field seen in the attached image.

 
Robert
Top achievements
Rank 1
 answered on 30 Nov 2012
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?