Telerik Forums
UI for ASP.NET MVC Forum
1 answer
516 views

In my search to resolve an issue I'm having, I found this post:

 

http://www.telerik.com/forums/select-text-although-allowrowselect-is-true

 

How do we set the EnableDragToSelectRows property to false using the Telerik UI for ASP.NET MVC (powered by Kendo UI) grid?  I have this applied:

 

.Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))

 

...and need to disable the marquee select so the users can select and copy text.  Thank you!

-Anthony

Dimiter Madjarov
Telerik team
 answered on 22 Feb 2016
1 answer
193 views

Hey there,

I'm currently using MVC, and have a view model that contains two Enumerables, each one representing a different series for use in the Donut Chart.

Normally, with a single enumerable, I would use the code below to bind the series.  

In my case the view model has two enumerables, Model.Series1 and Model.Series2.  How would I go about modifying this code to accommodate the two series?

@(Html.Kendo().Chart(Model)
    .Name("chart")
    .Title("Single Series")
    .Legend(legend => legend
        .Position(ChartLegendPosition.Bottom)
    )
    .Series(series =>
    {
        series.Donut(
            model => model.Value,  // The data to use
            model => model.Category, // The category Name
            model => model.Color, // The color to use for the category
            null // How far out the donut section should pop out
        );
 
    })
    .Tooltip(tooltip => tooltip
        .Visible(true)
        .Template("#= category # - #= kendo.format('{0:P}', percentage) #")
    )
)

Iliana Dyankova
Telerik team
 answered on 19 Feb 2016
6 answers
694 views

Hi,

     I tried to intercept "Edit" ClientEvent and argument properties are all undefined.  

 Here is the function and alerts are displayed, so I know the event is called.  What did I miss?

 

Thank you

        function onEdit(e)
        {
            alert(e.dataItem);
            alert(e.mode);
            alert(e.form);
            alert(e.isNew);
            if (e.mode == "edit" && (typeof e.dataItem != 'undefined') && (e.dataItem != null)) {
                alert('a');
                $(e.form).find('#Description').hide();
            }

        }

Slav
Telerik team
 answered on 19 Feb 2016
4 answers
211 views

I've noticed then in new version (2016.1.112) of component KendoDropDownList was changed the logic of the change event. In previous version (2015. 3.1111) in the change function I don't have to return the proper value. Below is the razor code that works fine.

...................
                <tr>
                    <td class="required-label">
                        @Html.LabelFor(m => m.FolderId)
                    </td>
                    <td>
                        @(Html.Kendo().DropDownList().Name("FolderId")
                              .HtmlAttributes(new { @class = "select-list" })
                              .OptionLabel("-- WYBIERZ RODZAJ ZGŁOSZENIA --")
                              .DataTextField("Description")
                              .DataValueField("Symbol")
                              .DataSource(source => source.Read(read => read.Action("GetFolders", "Zgloszenia"))))
                    </td>
                </tr>
                <tr>
                    <td class="required-label">
                        @Html.LabelFor(m => m.Subject)
                    </td>
                    <td>
                        @Html.Kendo().TextBoxFor(m => m.Subject).HtmlAttributes(new { @class = "textboxlong" })
                    </td>
                </tr>
                <tr>
                    <td>
                        @Html.LabelFor(m => m.ForeignCode)
                    </td>
                    <td>
                        @Html.Kendo().TextBoxFor(m => m.ForeignCode)
                    </td>
                </tr>
                <tr>
                    <td class="required-label">
                        @Html.LabelFor(m => m.ProductId)
                    </td>
                    <td>
                        @(Html.Kendo().DropDownList().Name("ProductId")
                              .HtmlAttributes(new { @class = "select-list", data_val = "true", data_val_required = "Musisz wybrać odpowiedni program z listy" })
                              .OptionLabel("-- Wybierz produkt, którego dotyczy zgłoszenie --")
                              .DataTextField("DescriptionValid")
                              .DataValueField("Symbol")
                              .DataSource(source => source.Read(read => read.Action("GetProducts", "Zgloszenia").Data("filterProducts"))
                                  .ServerFiltering(true))
                              .Enable(false)
                              .AutoBind(true)
                              .CascadeFrom("FolderId")
                              )
                    </td>
                </tr>
..................
<script>
    $(function () {
        var folderObj = $("#FolderId");
        if (folderObj) {
            folderObj.data("kendoDropDownList").setOptions({
                change: function (e) {
                    var folderVal = folderObj.val();
                    if (folderVal == "ZSER") {
                        $("#versionLabel").removeClass("required-label");
                        $("#Version").removeAttr("data-val-required");
                    } else {
                        $("#versionLabel").addClass("required-label");
                        $("#Version").attr("data-val-required", "Podanie wersji programu jest wymagane");
                    }
                }
           });
        }
    });
</script>
 

 In the new version it turned out that my dropdownlist doesn't work, operator cannot choose the item. Exactly after clicking on, it drop down, but after choosing the item it still remains the previous one. It looks like someone has disabled the control. I've found that if add to my function return value, everything will be OK.  My question is if this logic will be developed in the future? Should I always remember to return the proper value? Below is new version of this function.

<script>
    $(function () {
        var folderObj = $("#FolderId");
        if (folderObj) {
            folderObj.data("kendoDropDownList").setOptions({
                change: function (e) {
                    var folderVal = folderObj.val();
                    if (folderVal == "ZSER") {
                        $("#versionLabel").removeClass("required-label");
                        $("#Version").removeAttr("data-val-required");
                    } else {
                        $("#versionLabel").addClass("required-label");
                        $("#Version").attr("data-val-required", "Podanie wersji programu jest wymagane");
                    }
                }
                return folderVal;
            });
        }
    });
</script>

Janusz
Top achievements
Rank 1
 answered on 19 Feb 2016
1 answer
277 views

I'm having to dynamically create instances of the kenod dropdownlist and I have it working fine except I need to know what the equivalent syntax for defining the datasource.

 

Here is the razor server-side syntax:

 

@(Html.Kendo().DropDownList()
                        .Name("lineItemTypeCode")
                        .OptionLabel("..........")
                        .HtmlAttributes(new { style = "width:100%", @class = "itemTypeClass", required = "required" })
                        .DataValueField("Code")
                        .DataTextField("Name")
                        .DataSource(source => { source.Read(read => { read.Action("GetItemTypes", "RequestPONumber").Data("GetSelectedLocation"); }); })
      )

Action is GetItemTypes

Controller is RequestPONumber

Here is my client-side:

var newItemTypeDdl = $("#itemTypeddl" + poLinesCount).kendoDropDownList(
            {
                dataTextField: 'Name',
                dataValueField: 'Code',
                dataSource: ??????,
                optionLabel: "..........",
            });

 

Georgi Krustev
Telerik team
 answered on 19 Feb 2016
1 answer
192 views

Hello everyone.

Setup

I am using Telerik MVC Datepicker control to allow the user to select a date.

My date range is between the beginning of 1997 to current day.

The list of Valid dates are in a database and can be called via Stored Procedure.

My current list of valid dates number about 3500 and most represent end of month dates (though not always).

I want to disable all the other dates in my date picker so that the user only has access to dates that have data associated with them.

Is there a way to use the DisableDates feature of the Datepicker to do this?

 

Thanks

Corey

Kiril Nikolov
Telerik team
 answered on 19 Feb 2016
1 answer
88 views

I'm trying to get my chart title to be dynamic based on data in my chart.  However, since changing my ViewModel, I'm not getting any data in the chart to show up.  Here's my code so far.
ViewModel:

public class TargetZeroDetail
    {
        public String Title { get; set; }
        public List<TargetZeroDetails> Details { get; set; }
    }
 
    public class TargetZeroDetails
    {
        public DateTime DetailDate { get; set; }
        public String ShortDetailDate
        {
            get
            {
                return String.Format("{0:M/dd}", DetailDate);
            }
        }
        public Decimal Score { get; set; }
    }
 

 Controller:

public ActionResult Index()
{
    return View();
}
     
public ActionResult GetChartData([DataSourceRequest] DataSourceRequest request, DateTime passedDate)
{
    TargetZeroDetail data = Utility.GetTargetZeroData(passedDate);
    return Json(data, JsonRequestBehavior.AllowGet);
}

View: 

 

@model Utilities.TargetZeroDetail
 
<head>
    <link href="~/Content/kendo/2015.3.1111/kendo.common.min.css" rel="stylesheet" />
    <link href="~/Content/kendo/2015.3.1111/kendo.material.min.css" rel="stylesheet" />
    <link href="~/Content/kendo/2015.3.1111/kendo.blueopal.min.css" rel="stylesheet" />
    <script src="~/Scripts/kendo/2015.3.1111/jquery.min.js"></script>
    <script src="~/Scripts/kendo/2015.3.1111/kendo.all.min.js"></script>
    <script src="~/Scripts/kendo/2015.3.1111/kendo.aspnetmvc.min.js"></script>
</head>
<body>
    @{
        DateTime dateToPass = Convert.ToDateTime(Request.QueryString["date"]);
        if (dateToPass == DateTime.MinValue)
        {
            dateToPass = new DateTime(DateTime.Now.Date.Year, DateTime.Now.Month, 1);
        }
    }
    <table>
        <tr>
            <td valign="top">
                @(Html.Kendo().Button()
                    .Name("prevButton")
                    .Content("Previous Month")
                    .Icon("expand-w")
                    .Events(ev => ev.Click("onPrevClick"))
                )
            </td>
            <td>
                <div id="example">
                    <div id="chart">
                        @(Html.Kendo().Chart(Model.Details)
                            .Name("targetZeroChart")
                            .DataSource(dataSource => dataSource
                                .Read(read => read.Action("GetChartData", "Home", new { passedDate = dateToPass }))
                            )
                            .ChartArea(ca => ca.Height(690).Width(690))
                            .Title(Model.Title)
                            .Legend(false)
                            .SeriesDefaults(series => series
                                .RadarLine()
                                .Width(0)
                                .Markers(markers => markers
                                    .Visible(true)
                                    .Background("blue")
                                    .Border(border => border
                                        .Width(2)
                                        .Color("blue")
                                    )
                                )
                                .Tooltip(tooltip => tooltip
                                    .Visible(true)
                                    .Background("white")
                                )
                            )
                            .Series(series => series
                                .RadarLine(d => d.Score)
                            )
                            .CategoryAxis(axis => axis
                                .Categories(m => m.ShortDetailDate)
                            )
                            .ValueAxis(axis => axis.Numeric()
                                .Labels(l => l.Visible(false))
                                .Line(l => l.Visible(false))
                                .PlotBands(pb =>
                                {
                                    pb.Add().Color("green").From(0).To(1).Opacity(0.5);
                                    pb.Add().Color("yellow").From(1).To(2).Opacity(0.5);
                                    pb.Add().Color("gold").From(2).To(3).Opacity(0.5);
                                    pb.Add().Color("orange").From(3).To(4).Opacity(0.5);
                                    pb.Add().Color("red").From(4).To(10).Opacity(0.5);
                                })
                            )
                        )
                    </div>
                </div>
            </td>
            <td valign="top">
                @(Html.Kendo().Button()
                    .Name("nextButton")
                    .Content("Next Month")
                    .Icon("expand")
                    .Events(ev => ev.Click("onNextClick"))
                    .HtmlAttributes(new
                    {
                        @class = "right-icon"
                    })
                )
            </td>
        </tr>
    </table>
    <style>
        .right-icon .km-button .km-icon {
            float: right;
            margin-left: 0.3em;
        }
    </style>
    <script>
        function onPrevClick(e) {
            var newAddress = getPathFromUrl(window.location.href);
            if (newAddress.indexOf("Home") < 0) {
                newAddress += "Home/Index";
            }
            newAddress += "?date=@dateToPass.AddMonths(-1).Date.ToShortDateString()";
            window.location.replace(newAddress);
        }
 
        function onNextClick(e) {
            var newAddress = getPathFromUrl(window.location.href);
            if (newAddress.indexOf("Home") < 0) {
                newAddress += "Home/Index";
            }
            newAddress += "?date=@dateToPass.AddMonths(1).Date.ToShortDateString()";
            window.location.replace(newAddress);
        }
 
        function getPathFromUrl(url) {
            return url.split(/[?#]/)[0];
        }
 
        $("#chart").css("width", "700px").css("height", "700px")
                    .data("kendoChart");
    </script>
</body>

I'm assuming that since my initial call to the controller simply returns an empty View, that's why this is happening.  However if I were to make the call to get data to return to my view initially, it still doesn't show up.

What am I missing here?

T. Tsonev
Telerik team
 answered on 19 Feb 2016
3 answers
420 views
Hi 

I Am Using Telerik reporting DLL for Export PDF .

But When I export data With Unicode Character Not Support in PDF.

for E.X => Original String  ==>  PѐrustamismэnoЁcoToPat 520
                    In  PDF               ==>  P􀀀rustamismэnoЁcoToPat 520

 

unicode Character not supported.


please help us

Thanks in advance

Stef
Telerik team
 answered on 18 Feb 2016
1 answer
327 views

I am at a disadvantage because not only am I new to Kendo UI, but I am new to MVC as well.

Using the Save method inside Kendo UI Grid, I ALSO need to access a selected value from a Kendo Drop Down List.

For the life of me, I cannot figure out how to access the value.

Can someone assist? 

Here is some code:

Drop Down List:

@(Html.Kendo().DropDownListFor(m => m.SelectedPrinter)
.Name("Printers")
.HtmlAttributes(new { style = "width:100%" })
.OptionLabel("Select printer...")
.DataTextField("Name")
.DataValueField("ID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetCascadePrinters", "Home")
.Data("filterProducts");
})
.ServerFiltering(true);
})
.Enable(false)
.AutoBind(false)
.CascadeFrom("Locations")
)

Grid:

.DataSource(dataSource => dataSource.Ajax()
.Model(
model =>
{
model.Field(f => f.UserName).Editable(false);
model.Field(f => f.FirstName).Editable(false);
model.Field(f => f.LastName).Editable(false);
model.Field(f => f.PrincipalCreationDate).Editable(false);
model.Id(p => p.UserName);
}
)
.Read("Editing_Read", "Home")
.Update("Editing_Update", "Home")
.ServerOperation(false)
.Batch(true)

Controller:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Editing_Update([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<User> usr, UsersViewModel uvm, string SelectedPrinter)
{

// Check if model is valid
// Get User from UserID
// Build Trigger File
// Send to Bartender Trigger Directory
if (usr != null && ModelState.IsValid)
{
foreach (var product in usr)
{
// productService.Update(product);
}
}
return Json(usr.ToDataSourceResult(request, ModelState));
}

Any Help is appreciated.

Danail Vasilev
Telerik team
 answered on 18 Feb 2016
1 answer
141 views
Hi, I know this is maybe a strange question but I'd like to inquire about the behavior when sorting on a column where all values are the same.  I would expect that nothing changes, however that is not the case,  rows seem to sort randomly.  What sort is being applied in this case?  The interesting thing is I have two columns like that, and they both get sorted in the exact same order, so there is some logic I just can't tell what it is.  The behavior should be that if column values are all the same no sort is applied (this is how the silver light grid which I'm migrating from works). 
Angel Petrov
Telerik team
 answered on 18 Feb 2016
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
DropDownButton
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
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
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?