Telerik Forums
UI for ASP.NET MVC Forum
2 answers
88 views

I have created a few HtmlHelper extension methods that we use is different projects at my company, but they've usually been single level type of method calls, with a variable list of parameters.  But how does Kendo create the HTML Helpers such as those found in the Telerik MVC collection, with nested method calls?

For example, I've easily create a razor helper that parses a session variable for Claim data, and return the appropriate claim value based on the type.  Such as 

@{
    ViewBag.Title = "Vensure.Dashboard.App";
 
    string FullName = Html.GetClaimValue("fullname");
    bool isAdmin = Html.GetClaimValue("app-roles").Contains("admin");
}

 

But the Kendo components typically have multiple methods extending the initial method.  Such as:

@(Html.Kendo().DropDownList()
        .Name("availableClients")
        .DataTextField("ClientName")
        .DataValueField("ClientId")
        .DataSource(ds => ds.Read("GetClientList", "Mapping"))
        .Template("<span class=\"k-state-default\">#: data.ClientId # - #: data.ClientName #</span>")
        .ValueTemplate("<span class=\"selected-value\">#:data.ClientId# - #:data.ClientName#</span>")
        .HtmlAttributes(new { style = "width: 100%" })
        .Events(e => e.Change("clientChange"))
        .OptionLabel(" -- Select Client --")
        .Height(400)
    )

 

I'm just curious as to what the HtmlHelper extension code looks like to support the .Method().OtherMethod().YetAnotherMethod() nested syntax...

Kiril Nikolov
Telerik team
 answered on 26 Dec 2016
13 answers
848 views

Using this as a template: http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Editing/add-row-when-tabbed-out-of-last-row

I have made it so I can tab into the next row. But I noticed that it will always select the first required column based on data annotation, instead of the first column. Is this by design, or is there a way to set it to so that it goes to the first column always?

Marin
Telerik team
 answered on 23 Dec 2016
12 answers
636 views

I have a grid with a pop-up edit form, with a cascading dropdown list. It works fine except that when choosing to add a new record, the form opens and the dropdown list shows the validation error message before the user has done anything.

 

I've attached a screenshot. The definition of the dropdown lists is:-

  <p>
        <span class="fieldlabel">
            System:
        </span>
        @(Html.Kendo().DropDownListFor(m => m.system)
.Name("system")
.OptionLabel("Select a system")
.DataValueField("Code")
.DataTextField("Description")
.DataSource(src => src.Read(rd => rd.Action("GetSystems", "Home")))
 
        )
 
        @Html.ValidationMessageFor(model => model.system)
 
</p>
 
    <p>
        <span class="fieldlabel">
            Priority:
        </span>
        @(Html.Kendo().DropDownListFor(m => m.Priority)
.Name("Priority")
.OptionLabel("Select a priority")
.DataValueField("Code")
.DataTextField("Description")
.DataSource(src => src.Read(rd => rd.Action("GetPriorities", "Home")))
 
        )
 
        @Html.ValidationMessageFor(model => model.Priority)
 
    </p>
 
 
    <p>
        <span class="fieldlabel">
            Sub Category:
        </span>
        @(Html.Kendo().DropDownListFor(m => m.SubCategoryCode)
.Name("SubCategoryCode")
.OptionLabel("Select a sub category")
.DataValueField("Code")
.DataTextField("Description")
.DataSource(src => src.Read(rd => rd.Action("GetSubCategoriesbySystem", "Home").Data("filterSystems")).ServerFiltering(true))
 .Enable(false)
.AutoBind(false)
.CascadeFrom("system")
 
        )
 
        @Html.ValidationMessageFor(model => model.SubCategoryCode)
 
    </p>

How can I stop this?

 

Thanks

Ivan Danchev
Telerik team
 answered on 23 Dec 2016
1 answer
224 views
Whenever we right click on kendo spreadsheet, context menu with following options cut, copy, paste and merge appear. I want  to add more options like disable in this context menu. Please let me know how is it possible right now. I did not find any example for achieving this.
Dimitar
Telerik team
 answered on 23 Dec 2016
6 answers
582 views
Hi Guys,

I have added  toolbar.Create() and toolbar.custom() button on grid and redirected to open popup window from custom button,then  it opens popup window for 1 second and gives the error as attached. My code is below.

 .DataSource(dataSource => dataSource
            .Read(read => read.Action("_ServiceRegimeSequenceList", "ServiceRegimeSequenceList"))
            .Update(update => update.Action("_ServiceRegimeSequenceEdit", "ServiceRegimeSequenceList"))
            .Create(create => create.Action("_ServiceRegimeSequenceCreate", "ServiceRegimeSequenceList"))
            .Destroy(destroy => destroy.Action("_ServiceRegimeSequenceDelete", "ServiceRegimeSequenceList"))
        )
 .ToolBar(toolbar =>
                 {
                     toolbar.Create().HtmlAttributes(new { @id = "AddbuttonID", @style = "color: black;" });
                     toolbar.Custom().Name("Create kit").HtmlAttributes(new { @id = "CreatekitID" });
                   
                 })

@(Html.Kendo().Window()
        .Name("window")
        .Width(830)
        .Height(315)
        .Draggable()
        .Resizable()
        .Modal(true)
        .Title("Create Kit")
        .Actions(actions => actions.Refresh().Maximize().Close())
            .Content(@<text>
        <div id="workshopKitModalWindow">
        </div>
        </text>)
    )
<script type="text/javascript">
$(document).ready(function () {
        $("#CreatekitID").click(function (e) {
            $("#workshopKitModalWindow").load('@Url.Action("","")');
            $("#window").data("kendoWindow").center().open();
        });

    });
</script>
Viktor Tachev
Telerik team
 answered on 23 Dec 2016
1 answer
229 views
How to export every tab's content to pdf by tab's order
Anton
Telerik team
 answered on 23 Dec 2016
2 answers
281 views

Please see attached project, when clicking on the grid detail expand button windows scrolls to the top and a # is appended to the url in the address bar. Detail row does not expand. Works correctly in earlier versions. Did something change, am I missing a resource?

Thank you

Nik

Nikita
Top achievements
Rank 2
Iron
Iron
 answered on 22 Dec 2016
1 answer
262 views

Hi,

I am unable to use the search box when checkbox column filtering is enabled.

Please take a look at the first screenshot with the comments, describing the behavior.

Please note, the search box from the screenshot is not usable when I have grid column menu enabled and use Chrome browser.

If I disable column menu then the search box is usable.

Attached is the solution, containing the test application.

Any thoughts?

Thank you,

Vlad

Viktor Tachev
Telerik team
 answered on 22 Dec 2016
2 answers
174 views

Please provide link with example for Template function with the mentioned parameter

class GridColumnFilterableCellSettingsBuilder// Summary:
        //     Sets JavaScript function which to modify the UI of the filter input.
        public GridColumnFilterableCellSettingsBuilder Template(Func<object, object> handler);

 

 

 

 

Vladimir Iliev
Telerik team
 answered on 22 Dec 2016
2 answers
89 views

I have a form that has three dropdowns and a file upload control, all Kendo components.  I'd like the initial state of the Upload component to be disabled until the user has selected the appropriate values from the dropdowns.  I have all the dropdowns working appropriately, and their change events are all wired up, but I need to have the initial state of the uploader disabled until all three dropdowns have been answered, and then enable the upload.

In the uploader event, I have the select event wired into the validation, but it doesn;t actually fire until the user has selected a file, whereas I don;t want them to select the file even until the dropdowns have been answered.  What is the best way to do this?

$("#FileUpload1").kendoUpload({
    async: {
        saveUrl: "@Url.Action("UploadFile", "Mapping")"
    },
    upload: function(e) {
        e.data = {
            clientId: viewModel.get("ClientId"),
            uploadType: viewModel.get("uploadType"),
            payrollType: viewModel.get("payrollType")
        }
    },
    multiple: false,
    localization: {
        "select": "Select file to import..."
    },
    select: function (e) {
        if ((viewModel.get("ClientId") === "") ||
            (viewModel.get("uploadType") === "") ||
            (viewModel.get("payrollType") === "")) {
            alert("Please Make All Appropriate Selections Before Uploading");
            e.preventDefault();
            return;
        }
        var extension = e.files[0].extension.toLowerCase();
        if (ALLOWED_EXTENSIONS.indexOf(extension) === -1) {
            alert("Please, select a supported file format");
            e.preventDefault();
            return;
        }
    },
    success: function(e) {
        spreadsheetWrapper.show();
        // Load the converted document into the spreadsheet
        $("#spreadsheet").data("kendoSpreadsheet").fromJSON(e.response);
        $("#uploadForm").hide();
    }
});

 

Joe
Top achievements
Rank 1
 answered on 21 Dec 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?