Telerik Forums
UI for ASP.NET MVC Forum
1 answer
165 views
I have MVC 4 project and using a listview with edit.
When I use en-US culture everything work as aspected. I got problem with my native sv-SE culture however. Firt I used the 2012-3 release but after the problem I tryed the 2013 release unfortunately with same result.
Problem with sv-SE.
fields with decimal comma seperator does not work (both decimal and double) cant save to the database. No validation errors.
I tested with culture fr-FR same result.
SO I tested with de-DE and suddenly the save to database worked. However all values was 10 times bigger. eg. 14,5 was saved as 145.
The errors was only when I use decimal comma value bigger than 0. eg 10,0 works but 10,xx does not.
I asume Kendo MVC cant be so bad so I have to do something wrong, but I cant find the error.

In all test I change webconfig to use the the culture I test. I load the coresponding kendo js too and I set the kendo culture.
I run my machine in my native culture and the database have also Swedish collation.

If I use a "normal" edit and save all works as it shoud do.

Do I need some other js to get the Kendo UI json transport to work for other cultures than US.

If I cant work this out maybe my try just will be a try. Hopefully not as I invested a lot of time in this in the project in question.

Thanks in advance.
Jan

Daniel
Telerik team
 answered on 20 Mar 2013
1 answer
167 views
I have necessary to auto hide menu items when current user have not access to this action
below I present my custom filter attribute, based on AuthorizeAttribute
As you can see, if user can't have rights to action, system redirect him to AccessDenied action
but menu item binded on action market with this action filter, rendered always
please help

public class PermissionOnEntityActionAttribute : AuthorizeAttribute
    {
         protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            var isAuthorized = base.AuthorizeCore(httpContext);
            if (!isAuthorized) return false;
          
            return securityModule.CurrentUserHasPermission(...);
        }

        protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
        {
            if (!filterContext.HttpContext.User.Identity.IsAuthenticated)
            {
                base.HandleUnauthorizedRequest(filterContext);
            }
            else filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary(new { controller = "Error", action = "AccessDenied" }));
        }
    }
Georgi Krustev
Telerik team
 answered on 19 Mar 2013
1 answer
105 views
I have a grid partial as follows:

@using (Ajax.BeginForm("DppExcpnUpdate",
"DppExcpn", new AjaxOptions
    {
        UpdateTargetId = "divDppExcpnContent"
    }))
        {       
            @(Html.Kendo().Grid(Model)
                  .Name("gridDppExcpn")
              .Columns(columns =>
              {
                  columns.Bound(item =>
item.DppExcpnUid).Hidden().Visible(false);
                  columns.Bound(p =>
p.OrglUser).Hidden().Visible(false);
                  columns.Bound(p =>
p.OrglStamp).Hidden().Visible(false);
                  columns.Bound(p =>
p.UpdtUser).Hidden().Visible(false);
                  columns.Bound(p =>
p.UpdtStamp).Hidden().Visible(false);
                  columns.Template(@<text></text>).Width(25).Title("").ClientTemplate("<div class='gridAction' param-DppExcpnUid='#=
DppExcpnUid #'></div>");
                  columns.Bound(item =>
item.EqpTyp)
                    .Title("Equipment Type")
                    .Sortable(false)
                    .Filterable(false)
                    .Width(150);
                  columns.Bound(item =>
item.DmgCd)
                    .Title("Damage Code")
                    .Sortable(false)
                    .Filterable(false)
                    .Width(120);
                  columns.Bound(item =>
item.Dscr)
                    .Title("Damage Description")
                    .Filterable(false)
                    .Sortable(false)
                    .Width(240);
                  columns.Bound(item =>
item.Rmks)
                    .Title("Remarks")
                    .Sortable(false)
                    .Filterable(false);
              })
             //.AutoBind(false)
                  .Editable(editable =>
editable.Mode(GridEditMode.InLine))
                                     .Events(e
=> e.DataBound("Mol.Mr.CONMOCodes.DppExcpn.Ux.gridDppExcpndataBound")
.Save("Mol.Mr.CONMOCodes.DppExcpn.Ux.gridDppExcpnSave"))
                 .DataSource(dataSource =>
dataSource.Ajax()
                       .Sort(sort =>
                                {
                                    sort.Add(m
=> m.LsrCode).Ascending();
                                })
                .Model(model => model.Id(p
=> p.DppExcpnUid))
                .Read(read => read.Action("DppExcpnRead",
"DppExcpn", new { lsrCode = strLsrCode }))
                                    .Create("DppExcpnCreate",
"DppExcpn")
                                    .Update("DppExcpnUpdate",
"DppExcpn")
                .Events(events =>
events.Error("Mol.Mr.CONMOCodes.DppExcpn.Ux.DppExcpnError")
.RequestEnd("Mol.Mr.CONMOCodes.DppExcpn.Ux.gridDppExcpnRequestEnd"))
             )
              .Selectable()
              .Pageable()
              .Sortable()
              .Filterable()
                  )
}

My model is like:

/// <summary>
        /// Get or set property for DmgCd property.
        /// </summary>
        /// //[Required]
        [DataMember]
        [UIHint("DmgCdEditor")]
        public string DmgCd { get; set; }

        /// <summary>
        /// Get or set property for Dscr property.
        /// </summary>
        [DataMember]
        public string Dscr { get; set; }

        /// <summary>
        /// Get or set property for Rmks property.
        /// </summary>
        [DataMember]
        //[UIHint("RemarksEditor")]
        public string Rmks { get; set; }

        /// <summary>
        /// Get or set property for EqpTyp property.
        /// </summary>
        [DataMember]
        [DisplayName("Equipment Type")]
        [UIHint("EqpTypEditor")]
        [ConcurrencyCheck]
        public string EqpTyp { get; set; }

The above editor template are :
DmgCdEditor:

@using Mol.Mr.CONMOCodes.Ux
@model string
@{
    MaxRepairAmtController ctrl = new MaxRepairAmtController();
    }
@(Html.Kendo().DropDownListFor(m => m)
          //.Name("DmgCd")
          .HtmlAttributes(new {style="width:99px;" })
                              .DataValueField("Value")
                                  .DataTextField("Text")
                                  .BindTo(ctrl.GetListData("DmgCd"))
)

EqpTypEditor:

@using Mol.Mr.CONMOCodes.Ux
@model string
@{
    MaxRepairAmtController ctrl = new MaxRepairAmtController();
    }
@(Html.Kendo().DropDownListFor(m => m)
          //.Name("EqpTyp")
          .HtmlAttributes(new {style="width:99px;" })
                              .DataValueField("Value")
                                  .DataTextField("Text")
                                  .BindTo(ctrl.GetListData("EqpTyp"))
)

Now the problem is:
My grid actually has 4 columns as :
Equipment Type
Damage Code
Damage Description
Remarks

Now on add/edit I am getting "Remarks" value always as null but if database already had value for the column then I can successfully edit it. Again, if I take out the editor templates from the grid partial then I am getting all the columns' values, but I can't take them out as all those are needed for my case.

Please help it is urgent. 
Petur Subev
Telerik team
 answered on 19 Mar 2013
2 answers
102 views
Here is how my code looks on a MVC app. 

<body>
    @Html.Kendo().Calendar().Name("calendarstart").Value(DateTime.Now)
    <button id="save">Set date</button>
    <script>
        $(document).ready(function () {
            $("#save").click(function () {
                var startDate = $("#calendarstart").data("kendoCalendar");
                $.post("/Home/Index", { StartDate: startDate.value() });
            });
        });
    </script>
</body>

The issue i see is that their is no tight binding like what you have on MVC view model binding. 

Jay

Petur Subev
Telerik team
 answered on 19 Mar 2013
1 answer
306 views
Hi,

In my model I have the following property:
/// <summary>
 /// Get or set property for EffDt property.
 /// </summary>
 [DataMember]
[UIHint("EffDateEditor")]
public DateTime? EffDt { get; set; }

whereas my editor template is as follows:
@model DateTime?
@(Html.Kendo().DatePickerFor(m => m).Format("dd-MMM-yyyy"))

Lastly my grid partial has the following:
columns.Bound(p => p.EffDt)
                    .Format("{0:dd-MMM-yyyy}")
                    .Title("Effective Date")
                    .Sortable(false)
                    .Filterable(false)
                    .Width(120);

Now whether I add new data or edit existing data the date column is always throwing validation error as can be seen in the attached file.

Please help this is urgent.
Vladimir Iliev
Telerik team
 answered on 19 Mar 2013
2 answers
84 views
.Clear() seems to clear all tools. Anyway to clear a single tool?
Rod
Top achievements
Rank 1
 answered on 19 Mar 2013
1 answer
74 views
The combination of a Kendo-Menu together with own <ul> Tags on the view causes render problems in Internet Explorer 8, if you hover the mouse over the first Kendo-Menu-Entry. On hovering, the view seems to be refreshed and the content is cleared. So you get an empty view.

This bug only happens in Internet Explorer 8. The only workaround I found so far is to avoid <ul> tags in the view.

@Kendo-Team: Can you reproduce the bug or do you need any additional informations?

Petur Subev
Telerik team
 answered on 19 Mar 2013
2 answers
413 views
Hi there

Architecturally I'm a tad confused, but do confess to being new to both MVVM and KendoUI, but the sell from Telerik is that Kendo UI is really easy to start implementing and that the MVC server wrappers help you out by creating javascript for you.

What I'm confused about is how to use both of these together, or even if one should. The only reference I can find anywhere is here, but it doesn't really help. I've also looked through the examples but the relationship is still not clear.

If I understand it, the MVVM framework runs in the client browser in order to abstract responsibilities but also to bind the ViewModel to the data (using 'Observable').

On the other hand, the MVC wrappers seem to create widgets which are bound to datasources.

Do these two technologies work together and if so, in what scenarios should they be used thus? What are the advantages? In some sense it appears to me as though using the MVC wrappers and binding to datasources negates the need for a client-side MVVC pattern.

Are there any simple example projects of using the MVC server wrappers and the Kendo MVVC framework, that provides a clear understanding of the benefits, please?

Thanks so much,

Paul.
Paul
Top achievements
Rank 1
 answered on 19 Mar 2013
1 answer
202 views
So is this the only way to pass the value that has been selected back to the server ...seems like way too much glue code , I have to have a hidden field, then need to use JS to fill that field etc etc

Jay

<body>
    @using (Html.BeginForm("Index", "Home", FormMethod.Post))
    {
        @Html.HiddenFor(m => m.StartDate)
 
        @(Html.Kendo().Calendar()
                  .Name("calendarStart")
                  .Value(DateTime.Now)
              )
         
        @Html.HiddenFor(m => m.EndDate)
 
        @(Html.Kendo().Calendar()
                  .Name("calendarEnd")
                  .Value(DateTime.Now)
                  )
         
        <button name="button" value="save">Save Date</button>
    }
 
    <script>
        $(document).ready(function () {
 
            var calendarStart = $("#calendarStart").data("kendoCalendar");
            $("#StartDate").val((moment(calendarStart.value()).format("YYYY-MM-DD")));
 
            calendarStart.bind("change", function (e) {
                $("#StartDate").val((moment(this.value())).format("YYYY-MM-DD"));
             
            });
 
            var calendarEnd = $("#calendarStart").data("kendoCalendar");
            $("#EndDate").val((moment(calendarEnd.value()).format("YYYY-MM-DD")));
 
            calendarEnd.bind("change", function (e) {
                $("#EndDate").val((moment(this.value())).format("YYYY-MM-DD"));
            });
 
        });
    </script>
</body>
Petur Subev
Telerik team
 answered on 19 Mar 2013
3 answers
249 views
I am using a Kendo Window for my application, and I want to remove the default Close button from the header. I am using the Clear() method, which by definition should clear out all actions. But when I run my application, the close button is still present on the window.

Here is the Razor code that builds the wondow. Notice the Actions section. Any help would be greatly appreciated! 
@(Html.Kendo().Window()
    .Name("LoadingWindow")
    .Visible(false)
    .Title("Loading...")
    .Modal(true)
    .Height(150)
    .Width(300)
    .Actions(a => a.Clear())
    .Content(@<text>
                  <div id="loading-details">Loading Data. Please wait.
                      <div id="divLoaderGif">
                          <img src="@Url.Content("~/Content/themes/ajax-loader.gif")" alt="Loading... Please wait..." />
                      </div>
                  </div>
              </text>)
)
Dimiter Madjarov
Telerik team
 answered on 19 Mar 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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
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
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?