Telerik Forums
UI for ASP.NET MVC Forum
1 answer
87 views
Just browse to the MaskedTextBox demo on a windows phone and you'll see the MaskedTextBox isn't working properly. Not a big issue for us, but wanted to report this one ;) I used  a Nokia Lumia 925 windows phone 8 latest update.
Georgi Krustev
Telerik team
 answered on 07 Jul 2014
3 answers
141 views
Hi I am trying to learn ASP.NET MVC and Kendo so i am a bit new to all stuff about scripting etc and i need your serious help.

I have two questions. I have a one chart with date functions which can be sortable by months, dates and years. I can get  all values from chart with clicking "by months, by years, by dates etc" and than everything is quite okay to this point.

What i want is, I need a simple grid near of my chart. When user click chart's script functions("by months, by years, by dates etc".) user can get a dynamic simple grid with chart's values. How can i do that?

My another question is how can i show, first 6 months of 2014 and last 6 months of 2014 with clicking script functions. How can i add them to ".configuration-horizontal" div.

Thanks for your help.

Mychart:
<td>
 
        <div align="center" id="MyChart">
            @(Html.Kendo().Chart(Model)
.Name("MyChartz")
    .Title(title => title
                                .Text("Aaaaa)")
                    .Position(ChartTitlePosition.Top))
 
   .Legend(legend => legend
        .Visible(true)
        .Position(ChartLegendPosition.Top))
.Series(series =>
{
    series
        .Column(model => model.aaa, categoryExpression: model => model.DateTime).Name("aaa Dosyalar")
        .Aggregate(ChartSeriesAggregate.Count);
    series
       .Column(model => model.bbb, categoryExpression: model => model.DateTime).Name("bbb Dosyalar")
       .Aggregate(ChartSeriesAggregate.Count);
 
})
.CategoryAxis(axis => axis
    .Date()
    .BaseUnit(ChartAxisBaseUnit.Months)
    .MajorGridLines(lines => lines.Visible(false))
)
      .Tooltip(tooltip => tooltip
    .Visible(true)
             .Template("#= series.name #: #= value #"))
            )
 
        </div>
 
    </td>


Script
<script type="text/javascript">
    $(".configuration-horizontal").bind("change", refresh);
 
    function refresh() {
        var chart = $("#chartMesleki258").data("kendoChart"),
        series = chart.options.series,
        categoryAxis = chart.options.categoryAxis,
        baseUnitInputs = $("input:radio[name=baseUnit]"),
        aggregateInputs = $("input:radio[name=aggregate]");
 
        for (var i = 0, length = series.length; i < length; i++) {
            series[i].aggregate = aggregateInputs.filter(":checked").val();
 
        }
 
        categoryAxis.baseUnit = baseUnitInputs.filter(":checked").val();
 
        chart.refresh();
    }
</script>


Hristo Germanov
Telerik team
 answered on 07 Jul 2014
1 answer
56 views
I am a newbie with Kendo MVC helpers.  I cannot find the detail document of Kendo MVC helpers.

For instance, the only document what I found for DropDownListFor() is

http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/dropdownlist/overview

 

But this document doesn’t list all of method, such as Value(), OptionLabel(), nor explains the arguments of the method.

Where can I find the Kendo MVC helpers’ documents?

 

Thanks.

Dimo
Telerik team
 answered on 07 Jul 2014
1 answer
98 views
Id like to add a button to delete all records referenced in a Kendo paged and filtered grid (all paged records) abiding by any grid filters

Obviously Telerik MVC extensions abstracts the work it does with iqueryable at the controller by the use of the extension ToDataSourceResult and the [DataSourceRequest] DataSourceRequest request parameter

So the questions are,

Is it possible to somehow create a custom controller action and associated front end code to pass the current filtering regime

Is it then possible in the action to delete all records associated with that filtering.

i might have a paged grid with 1000 records (10 per page), filtered by productId, it would be nice to be able to create a custom toolbar button called "delete all", to delete all the matched filtered recordsPlease note, the toolbar button i can do,

however im not sure if you have access to iqueriable and DataSourceRequest mechanism in a way that might make this feasible
Vladimir Iliev
Telerik team
 answered on 07 Jul 2014
1 answer
486 views
I have a grid whereas the columns are defined as: 

.Columns(columns =>
{
    columns.Bound(b => b.Field);
    columns.Bound(b => b.OldValue);
    columns.Bound(b => b.NewValue);
    columns.Bound(b => b.DateImported).Format("{0:dd-MMM-yyyy}");
    columns.Bound(b => b.BuildingChangeValidationStatusType).ClientTemplate("#=BuildingChangeValidationStatusType.Value#").Width(250);
    columns.Command(command => command.Custom("Update").Click("updateValidation"));
    columns.Command(command => { command.Edit(); }).Width(172);
})

The BuildingChangeValidationStatusType client template is defined as: 

@model Rep.Models.BuildingChangeValidationViewModel
@(Html.Kendo().DropDownList()
    .Name("BuildingChangeValidationStatusType") // Name of the widget should be the same as the name of the property
    .DataValueField("Id")
    .DataTextField("Value")
    .BindTo((System.Collections.IEnumerable)Model.BuildingChangeValidationStatuses)
)


I am wanting to pass the model for each row to the client template since each row will contain its own lookup values.  How can I accomplish this? 

Vladimir Iliev
Telerik team
 answered on 07 Jul 2014
5 answers
174 views
I use that:
    @(Html.Kendo().Grid<Lorem.Core.DataModels.Contacts.DMConEmail>()
    .Name("ContactEmails")
    .Columns(columns =>
    {
        columns.ForeignKey(p => p.Type, Html.GetEnumList(typeof(Lorem.Core.DataModels.Contacts.DMConEmailType)));
        columns.Bound(p => p.Email);
        columns.Command(command => { command.Edit(); command.Destroy(); });
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .DataSource(datasource => datasource.Ajax()
        .Model(model => model.Id(p => p.IdEmail))
        .Create(update => update.Action("EmailInsert", "Contact", new { idContact = Model.IdContact }))
        .Read(read => read.Action("EmailGetList", "Contact", new { idContact = Model.IdContact }))
        .Update(update => update.Action("EmailUpdate", "Contact"))
        .Destroy(update => update.Action("EmailDelete", "Contact"))
        ))

And I have a column that use an Enum to choose the email type. When I use that in a view, all is working fine. When I use it in an EditorTemplates I have this exception:
Ligne 1 : @model object
Ligne 2 :
Ligne 3 : @(
Ligne 4 : Html.Kendo().DropDownListFor(m => m)
Ligne 5 : .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])

[ArgumentNullException: La valeur ne peut pas ĂŞtre null.
Nom du paramètre : source]
System.Linq.Enumerable.Select(IEnumerable`1 source, Func`2 selector) +4090943
Kendo.Mvc.UI.Fluent.DropDownListBuilder.BindTo(IEnumerable`1 dataSource) +88
ASP._Page_Views_Shared_EditorTemplates_GridForeignKey_cshtml.Execute() in c:\DCM\SVNPortailDCM\trunk\Softwares\Lorem\MVC\Views\Shared\EditorTemplates\GridForeignKey.cshtml:3
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +104
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +235

Daniel
Telerik team
 answered on 04 Jul 2014
3 answers
987 views
Hi,

Sorry if I haven't searched enough to find a answer but can someone help me.

I put my application into production and all the dates seem to show the correct date minus 1 day. So instead of 1/6/2014 it shows 31/5/2014.

On local development PC the dates are correct and don't have this issue. All the functionality sorting filtering works but it just shows wrong date.

I use same browser  IE11  to view both sites.

I am using following to format date field in grid.

c.Bound(r => r.Effective_Status_Date).Width(150).Format("{0:dd/MM/yyyy}")

I tested the grid on the production server with a date field with no formatting and it shows the correct date if there is no formatting applied.

Production server is https:// but everything else seems to work except this date formatting.

Please let me know if there is a better way to get format  dd/mm/yyyy and not have this issue.

Thanks

Rob
Robert
Top achievements
Rank 1
 answered on 04 Jul 2014
1 answer
609 views
In the example code for the .cshtml file at http://demos.telerik.com/aspnet-mvc/grid/remote-data-binding there is read.Action() method near the end.  What are the parameters that are passed to it, in partciular the first one.  In the example the value is "Orders_Read".  Is this an entity?
Petur Subev
Telerik team
 answered on 04 Jul 2014
1 answer
57 views
Hi,
I have a datasource that contains an object (string) with a certain Order status code.
(e.g. "N", "A")

In my old asp.net application, I used to translate this code to a resource file in my application. (e.g. "N", becomes "New")
I used the onitemdatabound event (server side), to alter the contents of this cell.

What is the best approach to do this with asp.net mvc and kendo UI?
Would it be better that my WCF response already contains these translations? (however, I don't want to pass the culture to the WCF service I guess)
Or can kendo.ui Grid also change cell values (with some sort of jquery function that reads out a a resource file in my project?)

Thanks,
Nicolas
Petur Subev
Telerik team
 answered on 04 Jul 2014
1 answer
316 views
I have the following hierarchy grid that is server bound.  In the DetailTemplate I have tried 2 columns containing a Url.Action link.  The .ClientTemplate column does not render to the page as an anchor.  The .Template column has a syntax error at the @<text>.  How can I get a Url.Action column to render in the expansion hierarchy?

Thanks.
Dan

Code:
​
@model IEnumerable<EquipmentsSummary>
 
<div class="info-row">
    @(Html.Kendo().Grid(Model)
        .Name("EquipmentGrid")
        .Columns(columns =>
        {
            columns.Bound(e => e.ID).Hidden();
            columns.Bound(e => e.PatientId).Hidden();
            columns.Template(@<text>
                <a href="@Url.Action("EquipmentSettingEdit", Controllers.Employee, new { equipmentid=item.ID, settingid=0 }) "class='btn btn-sm'>Add</a>
                </text>).Width(75).Title("Add<br />Setting");
            columns.Bound(e => e.EquipName).Title("Item Name");
            columns.Bound(e => e.SerialNo).Title("Serial #");
            columns.Bound(e => e.AssetStatus).Title("Status");
            columns.Bound(e => e.AssetStatusDate).Title("Date");
        })
        .HtmlAttributes(new { style = "height: 500px;" })
        .Pageable(pageable => pageable
            .PageSizes(true).PageSizes(new int[] { 20, 50, 100 })
            .ButtonCount(5))
        .Sortable()
        .Filterable()
        .Scrollable()
        .DataSource(dataSource => dataSource.Server()
            .PageSize(20))
        .DetailTemplate(
            @<text>
                @(Html.Kendo().Grid(item.SettingItems)
                    .Name("Settings_" + item.ID)
                    .Columns(columns =>
                    {
                        columns.Bound(s => s.SettingID).Hidden();
                        columns.Bound(s => s.EffectiveDate).Title("Date").Format("{0:g}");
                        columns.Bound(s => s.AssetStatus).Title("Status");
                        columns.Bound(s => s.Clinician);
                        columns.Bound(s => s.SettingID).ClientTemplate(
                            "<a href='" + Url.Action("EquipmentSettingEdit", Controllers.Employee) + "/?equipmentid=#=item.ID#&settingid=#=SettingID#'" + "class='btn btn-sm'>Details</a>"
                            ).Width(75).Title("").Filterable(false);
                        columns.Template(
                            @<text>
                            <a href='@Url.Action("EquipmentSettingCopy", Controllers.Employee)' class='btn btn-sm'>Copy</a>
                            </text>).Width(75).Title("").Filterable(false);
                    })
                    .DataSource(dataSource =>dataSource.Server().PageSize(20))
                         
                    .Pageable(pageable => pageable
                        .PageSizes(true).PageSizes(new int[] { 20, 50, 100 })
                        .ButtonCount(5))
                    .Sortable()
                    .Filterable()
                    .Scrollable()
                )
            </text>
        )
        .RowAction(row =>
        {
            if (row.Index == 0)
            {
                //row.DetailRow.Expanded = true;
            }
            else
            {
                var requestKeys = Request.QueryString.Keys.Cast<string>();
                var expanded = requestKeys.Any(key => key.StartsWith("Settings_" +
                    row.DataItem.ID) ||
                    key.StartsWith("SettingItems_" + row.DataItem.ID));
                row.DetailRow.Expanded = expanded;
            }
        })
         
    )
 
</div>
Petur Subev
Telerik team
 answered on 03 Jul 2014
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
Licensing
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?