Telerik Forums
UI for ASP.NET MVC Forum
6 answers
5.5K+ views
I am trying to add HTML5 data- attributes to a data bound column in an MVC grid.

I'm looking for something like this without having to resort to using a template.  Obviously, the syntax in the new object is invalid because of the hyphens.
columns.Bound(i => i.InvoiceNumber).Title("Company").HtmlAttributes(new { data-company-id = @item.CompanyId});

Is there a way to accomplish this?
li
Top achievements
Rank 1
 answered on 11 May 2017
1 answer
524 views
Anyone know why my DateTime is losing milliseconds when returning back to the server from a grid? E.g. I use Entity framework to select a SQL DateTime value (UTC) and populate a Kendo grid. Then during the grid's update event if I check the date it seems to have lost its milliseconds. I'm trying to use this for concurrency checking and it needs to be precise. Any ideas would be greatly appreciated!
Georgi
Telerik team
 answered on 11 May 2017
5 answers
531 views
Hi,
I am using the below code to call the update event of the data source. 
<script>
function error(e) {
            var grid = $("#gantt").data("kendoGantt");
            grid.one("dataBinding", function(args) {
                e.preventDefault();
            });
            if (e.errors) {
                var msg = "";
                $.each(e.errors, function(key, value) {
                    if (value.hasOwnProperty("errors")) {
                        $.each(value.errors, function() {
                            msg += this + "<br />";
                        });
                    }
                });
             alert(msg);
            }
        }
</script>

@(Html.Kendo().Gantt<TaskGantt, TaskGanttDependency>()
    .Name("gantt")
    .DataSource(ds => ds
                        .Read(read => read
                            .Action("Tasks", "Home")
                        )
                        .Update(update => update
                            .Action("Update", "Home")
                        )
                        .Events(events => events
                          .Error("error")
                        )
                        .Model(m =>
                        {
                            m.Id(f => f.Id);
                            m.ParentId(f => f.ParentId);
                            m.OrderId(f => f.OrderId);
                            m.Field(f => f.Expanded).DefaultValue(true);
                        })
                    )
                    .DependenciesDataSource(ds => ds
                        .Read(read => read
                            .Action("Dependencies", "Home")
                        )
                        .Model(m =>
                        {
                            m.Id(f => f.DependencyId);
                            m.PredecessorId(f => f.PredecessorId);
                            m.SuccessorId(f => f.SuccessorId);
                            m.Type(f => f.Type);
                        })
                    )
                    
    .Columns(columns =>
    {
        columns.Bound("title").Editable(true).Sortable(true);
        columns.Bound("end").Title("End Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(true).Sortable(true);  
    })
    .Views(views =>
    {
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
    })
    .Events(events=> events
        .DataBound("onDataBound")
    )
    .Height(500)
    .ShowWorkHours(false)
    .ShowWorkDays(false)
    .Snap(false)
    .Resizable(true)
    )
The update event is getting triggered multiple times when i am trying to update a single task inline. I want the update event to get triggered only once for a single task update.I have also attached the image which indicates the multiple event trigger for the inline edit of the highlighted child task.Can anyone help me in where i am going wrong or what has to be done to prevent the multiple event triggers.

Thanks
Veselin Tsvetanov
Telerik team
 answered on 11 May 2017
7 answers
1.9K+ views
The code below works fine. I need to add a column to the grid that shows an image 
(bound or not bound I don't care as long as the image shows and not the model property).
The new column should launch a Kendo Window widget with a string property of the model
serving as the input content of the Kendo Window. The property on the model might be something like
model.FailureMessage.

Thanks,

Html.Kendo().Grid(Model.AppointmentList).Name("FailedAppointments")             
    .Columns(columns =>             
    {                 
            columns.Bound(o => o.MemberFirstName).Title("Member First Name").Width(50);                 
            columns.Bound(o => o.MemberLastName).Title("Member Last Name").Width(50);                 
            columns.Bound(o => o.ClientMemberID).Title("Client ID").Width(50);                 
            columns.Bound(o => o.ProviderID).Title("Provider ID").Width(50);                 
            columns.Bound(o => o.ProviderFirstName).Title("Provider First Name").Width(50);                 
            columns.Bound(o => o.ProviderLastName).Title("Provider Last Name").Width(50);                 
            columns.Bound(o => o.AppointmentDate).Title("Appointment Date").Width(50);                 
            columns.Bound(o => o.IHAAppointmentID).Hidden(true);             
    })             
    .Pageable(pager => pager.PageSizes(true))             
    .Sortable(sorting => sorting.SortMode(Kendo.Mvc.UI.GridSortMode.SingleColumn))             
    .Scrollable(scrolling => scrolling.Height(300))             
    .TableHtmlAttributes(new { Class = "dataGridTable" })                             
   
Dimo
Telerik team
 answered on 11 May 2017
6 answers
187 views

There is censored network in Mainland China. Everything from the servers which are not in Mainland China is slow.

So if I want to improve the static files' loading performance, can I put the Telerik's static files(include the themes) on our own CDN, which files should we do?

K'Library
Top achievements
Rank 1
 answered on 11 May 2017
1 answer
614 views

Hi,

 

Our DatePicker's Validation Message is overlapping with the DatePicker's input. I attached an image of the problem.

 

It seems that the <span> element containing the validation message is in the wrong location for the DatePicker. On the same page we have a ComboBox, which has the validation <span> element one level higher than the DatePicker. I tried this in Chrome and moved this element:

<span class="k-widget k-tooltip k-tooltip-validation k-invalid-msg field-validation-error" data-for="SubscribeTill" data-valmsg-for="SubscribeTill" id="SubscribeTill_validationMessage" role="alert">

 

up one level, from inside this element:

<span class="k-picker-wrap k-state-default">

 

to inside this element:

<span class="k-widget k-datepicker k-header">

 

And after this, it seems to work exactly like the ComboBox.

 

It seems this is a bug, but we kind of need this working right now. Is there a way we can move this span manually?

 

Sincerely,

 

Tim

Stefan
Telerik team
 answered on 11 May 2017
1 answer
577 views

I am trying to use the Kendo DatePicker from code generated and rendered into the view, I can make it work when part of the cshtml

e.g.

In cshtml:

@(Html.Kendo().DatePicker().Enable(!Model.ReadOnly).Name("DatePick").Value("12/25/2017").HtmlAttributes(new { style="width: 10% ", title="datepicker" }))

works fine.

when rendering from

                            result.Append("@(Html.Kendo().DatePicker().Enable(" + !ReadOnly + ").Name(\"a" + PrimKey + "\").Value(\"" + theDate + "\").HtmlAttributes(new { style=\"width: 10%\", title=\"datepicker\" }))\r\n");

I just get the text and no control.

I am using the code generation for all my controls on the page as it is dynamic and not a preset layout

 

Tsvetina
Telerik team
 answered on 11 May 2017
3 answers
751 views

I have here a MENU which would show partial views as the content.

<div class="panel-body">
    <div id="row_menu" class="row" style="margin-top: -15px;">
        @(
            Html.Kendo().Menu()
                .Name("Menu_PatientDetails")
                .Items(items =>
                {
                    items.Add().Text("Patient Information").Selected(true).Enabled(false);
                    items.Add().Text("Insurance").Enabled(false);
                    items.Add().Text("Visits").Enabled(false);
                    items.Add().Text("Notes").Enabled(false);
                    items.Add().Text("Documents").Enabled(false);
                })
                .Events(e=>e.Select("openPatientDetails"))
        )
    </div>
 
    <div id="PatientInformationPanel">
        @Html.Action("ShowPatientInformation", "Patient")
    </div>
 
    <div id="PatientInsurancePanel" class="hidden">
        @Html.Action("ShowPatientInsurance", "Patient")
    </div>
 
    <div id="PatientYearPanel" class="hidden">
        @Html.Action("ShowPatientYear", "Patient")
    </div>
 
    <div id="CasesPanel" class="hidden">
        @Html.Action("ShowPatientCases", "Patient")
    </div>
    <div id="PatientDocumentPanel" class="hidden">
        @Html.Action("ShowPatientDocuments", "Patient")
    </div>
</div>

 

function openPatientDetails(e) {

Ianko
Telerik team
 answered on 10 May 2017
1 answer
192 views

I am trying to add a DDL to a toolbar template,  I have tried all sorts , including simple text in the toolbar.

 

But when I add the template , I always get a syntaxthe character befor the ampersand  (@<text>  as if the toolbar.template does not like the string as a paramater.  What could be wrong here .

 

My current code is below

 

I have tried simple divs with text and other things ,  but the issue is always the same.

 

  .ToolBar(toolbar =>
                                                        {
                                                          
                                                        toolbar.Template( @<text>
                                                                    <div class="toolbar">
                                                                        @(Html.Kendo().DropDownList()
                                                                                    .Name("CityId")
                                                                                    .DataTextField("Name")
                                                                                    .DataValueField("Value")
                                                                                    .OptionLabel("Select City...")
                                                                                .DataSource(source => source
                                                                                  .ServerFiltering(true)
                                                                                  .Custom()
                                                                                  .Transport(transport => transport
                                                                                        .Read(read =>
                                                                                        {
                                                                                            read.Url("/Api/Common/_GetCity/2")
                                                                                            .DataType("json");

                                                                                        })
                                                                                 )
                                                                                    )
                                                                        )
                                                                    </div>
                                                            </text>);




                                                        })

Viktor Tachev
Telerik team
 answered on 10 May 2017
1 answer
142 views
Using the new SASS themebuilder, I'm downloading the package and getting a valid variables.scss, however, the all.css file is empty and I planned on using that for my project.
Nencho
Telerik team
 answered on 10 May 2017
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
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?