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

Hi

I would like ask how to improve  example below to display text from drop down list after save item?

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/grid-editing-cascading-dropdownlist

Drop down lists work as I need but after save I see id. How to change it to display text for example category name.

 

 

Boyan Dimitrov
Telerik team
 answered on 14 Dec 2015
3 answers
100 views

Hi There,

I am trying to Get 'Copy To Excel' to work in Batch Edit Mode. (GridEditMode.InCell)

I used the Telerik example below (razor/grid/editing) and added the two following lines to be able to copy to Excel:

.Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Cell))
.AllowCopy(true)

(Telerik\UI for ASP.NET MVC Q2 2015\wrappers\aspnetmvc\Examples\VS2013)

However, I am not able to copy to Excel.

Here is the code with the added lines in bold:

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()    
    .Name("Grid")    
    .Columns(columns => {        
        columns.Bound(p => p.ProductName);
        columns.Bound(p => p.UnitPrice).Width(140);
        columns.Bound(p => p.UnitsInStock).Width(140);
        columns.Bound(p => p.Discontinued).Width(100);
        columns.Command(command => command.Destroy()).Width(110);
    })
    .ToolBar(toolbar => {
        toolbar.Create();
        toolbar.Save();        
    })
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Cell))
    .AllowCopy(true)

    .Pageable()
    .Navigatable()
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource        
        .Ajax()         
        .Batch(true)
        .PageSize(20)
        .ServerOperation(false)                
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.ProductID))
        .Create("Editing_Create", "Grid")
        .Read("Editing_Read", "Grid")
        .Update("Editing_Update", "Grid")
        .Destroy("Editing_Destroy", "Grid")
    )
)

Cheers,

Greg

Dimiter Madjarov
Telerik team
 answered on 11 Dec 2015
4 answers
321 views
I have a pivot grid against flat remote data source that is based on the demo but when I try to add multiple measures at runtime only the first measure is displayed.  I can add additional measures from the configurator after page loads but I need the measures to show up on initial page load.  Is this possible?
Erik
Top achievements
Rank 2
 answered on 10 Dec 2015
1 answer
901 views

Hi,
I am working on Kendo Grid with MVC.Net. I am using CRUD operations with editor template. I am unable to get the model id value in editor template to figure out if it is a new record or existing record.

 Here is my grid configuration which in cshtml file

@(Html.Kendo()
                          .Grid<TestRecord>()
                          .Name("Test")
                          .Columns(columns =>
                          {
                              columns.Bound(col => col.Id);
                              columns.Bound(col => col.Name);                            
                              columns.Command(command => { command.Edit(); command.Destroy(); });
                          })
                          .ToolBar(toolbar => toolbar.Create().Text("Add New Record"))
                          .Editable(editable => editable                                                       
                                                        .Mode(GridEditMode.PopUp)
                                                        .TemplateName("TestEditor"))
                          .Sortable()
                          .DataSource(dataSource =>
                          {
                              dataSource
                                        .Ajax()
                                        .ServerOperation(false)
                                        .Model(m =>
                                        {
                                            m.Id(a => a.Id);
                                            m.Field(a => a.Name)                                                                
                                        })
                                        .Read(read => read.Action("TestRead", "TestControl", new { id = this.Model.Id }))
                                        .Create(create => create.Action("TestRead", "TestControl"))
                                       
                              ;
                          })
                    )

 

My Editor is in separate file names TestEditor.cshtml. I am able to add/edit records without any issues. I need to update only one column if it is existing record. Hence I am hiding the remaining fields (other than the one I am updating) in the editor window. So I was wondering if I can use the model's Id column to figure out if it is a new record or not.

Here is my editor template : TestEditor.cshtml

@model TestRecord

// Render all the columns

@if (this.Model.Id > 0)
    {
    // only updated related column
    }
 

Regards,
Chen

Milena
Telerik team
 answered on 10 Dec 2015
5 answers
435 views

I have a chart, which allows the user to click on a column, to refresh the chart with data from the next level in the hierarchy.

It works well, apart from the rightmost columns, on narrower displays. In these cases, the tooltip completely obscures the column, making clicking on them difficult.

I've attached an example image.

The chart definition is:-

 

@(Html.Kendo().Chart<Dashboard.Models.BarChartDataItem>(Model)
            .Name((string)ViewBag.ChartName)
             .Title((string)ViewBag.ChartTitle)
             .Theme("bootstrap")             
 
            .Legend(legend => legend
                .Position(ChartLegendPosition.Top)
                .Visible(false)
            )
 
            .Series(series =>
            {
                series.Column(model => model.BarValue).Name("Actual").Tooltip(t=>t.Visible(true).Template("<div>Category:#=dataItem.AxisDescription#</br>Contribution: £#=dataItem.DisplayBarValue#</div>"));
            })
            .ChartArea(area => area
                .Height(350)
                .Background("transparent")
                )
 
                    .ValueAxis(axis => axis.Numeric()
                .Labels(labels => labels.Format("{0:N0}"))
                .Title((string)ViewBag.Yaxis)
                .AxisCrossingValue(0, int.MinValue)
 
 
 
                .Line(line => line.Visible(false))
            )
 
             .CategoryAxis(axis => axis
               .Labels(false))
            .CategoryAxis(axis => axis
 
                .Categories(model => model.AxisValue)
                .Labels(labels => labels.Rotation(-45).Padding(5))
                .MajorGridLines(lines => lines.Visible(false))
                 .Title((string)ViewBag.Xaxis)
 
 
            )
            
 
 
         
 
         
            .Events(e=>e.SeriesClick("seriesClick"))
 
            .Tooltip(tooltip => tooltip
                .Visible(true)
 
                .Format("{0:N2}")
            )
 
)

 

Is it possible to change the tooltip position? There don't seem to be any position options available.

 In this case, displaying at the top of the column would be best, ensuring nothing is obscured.

Thanks

Iliana Dyankova
Telerik team
 answered on 10 Dec 2015
1 answer
282 views

Good afternoon.

Are there any example projects where the following is happening:

1. Initial Spreadsheet control is blank.

2.  Upon selection of a an excel file .. loading it into the spreadsheet.

3.  Spreadsheet is in read only format.

I have looked at the following demo...

http://demos.telerik.com/aspnet-mvc/spreadsheet/server-side-import-export

 

but it is preloading something that 1.  I do not want, 2.  i cannot even find the json file it is uploading.

 I have tried to use the export function (to JSON) to export the initially loaded products json file and then reimport it using the code in the controller.... but it gives me serialization errors.

Thanks,

Corey

Alex Gyoshev
Telerik team
 answered on 10 Dec 2015
1 answer
79 views

Hi Guys,

 I have a grid that uses batch editing (GridEditMode.InCell).

This grid also uses a few Foreign Key columns.

 If I use the .Navigatable() option, I can tab through the cells, but the foreign key columns don't show up as pick list anymore but as integer.

I believe the following example would have the same issue if it had a foreign key column. 

http://demos.telerik.com/aspnet-mvc/grid/editing

is this a bug with MVC Grid or am I missing an option ?

Cheers,

Greg

 

 

Greg
Top achievements
Rank 1
 answered on 10 Dec 2015
1 answer
96 views

For some time, I've noticed some severe rendering problems when using Kendo numeric/integer text box widgets. Here's the scenario:

Currently, I'm using the latest version of everything (Windows 10 with update 1511, VS 2015 Update 1, latest Kendo), although the problems I'm seeing date back to Window 8/8.1 and VS 2013.

I've got an MVC app using Bootstrap.

In the particular case that I'm working on right now, I've got a form inside a dialog box (Kendo Window widget) that uses a number of different Kendo widgets for input (TextBox, DropDownList, IntegerTextBox).

When I use the IntegerTextBox (or other numeric) widget, rendering consistently just goes all to hell in the dialog box. Spinners disappearing are the least of it. A lot of the time, all the other HTML elements in the dialog box are being overlaid by something. When I move the mouse over various controls, they sometimes appear and sometimes disappear. Clicking on one of the numeric text boxes tends to make everything else disappear. If I remove all numeric text box widgets from the form, the problems disappear completely. Removing the form itself has no impact. Removing validators has no impact.

This occurs in both IE and Edge browsers, but only on my desktop system, never on my laptop or my Surface Pro 3. My desktop system has a second generation i7-2600 with Intel HD Graphics 2000. My laptop has a fourth generation i7-4700HQ with Intel HD Graphics 4600. My Surface Pro 3 has a fourth generation i5-4300U with Intel HD Graphics 4400. I don't see these types of problems when I surf around the web, just in the apps I'm developing with Kendo.

I'm almost at the point of having to buy another desktop computer with a newer processor/graphics just so I can do my work. The problem with that, as my wife wisely points out, is that my customers may run into this problem with the deployed app. Judging by other forum threads, other developers are seeing similar things, but no one seems to have been able to come up with an example that you can duplicate. I suggest you get a system similar to my desktop machine and try it on that. I think the problem is related to the interaction between the Intel HD Graphics 2000, Windows 8x/10, and Kendo. Intel has essentially dropped support for their HD Graphics 2000/3000 for version of Windows greater than 7 although, obviously, Windows 8x/10 installs and seems to otherwise work on those systems.


 
 
 
Georgi Krustev
Telerik team
 answered on 09 Dec 2015
1 answer
180 views

Hi,

 I am using Kendo.Mvc 2015.1.408.545

How can I use TypeScript / jQuery to set the values on a MultiSelect when Ajax and ServerFiltering are used as the DataSource?  I know the value and text as they have been saved to the database previously.  How can I set the values?  This is before user has used the MultiSelect to retrieve data using server filtering.

                      @(form.FormGroup().CustomControls(
                            Html.Kendo().MultiSelectFor(x => x.PKeys)
                            .HtmlAttributes(new { tabindex = "5" })
                            .Deferred()
                            .Name("pMultiSelect")
                            .AutoBind(false)
                            .DataTextField("Name")
                            .DataValueField("PKey")
                            .Filter(FilterType.StartsWith)
                            .MinLength(2)
                            .Placeholder("[All]")
                            .DataSource(source =>
                            {
                                source.Read(read => read.Action("AjaxFilterSearch", "P")
                                    .Data("pMultiSelectReadData"));
                                source.ServerFiltering(true);
                            })

                       ).LabelFor(x => x.PKeys))

I have tried JSON, string arrays, strings, using the MultiSelect.value() will not display what is in "Name" field.

 

Thanks very much

Gavin
Top achievements
Rank 1
 answered on 08 Dec 2015
2 answers
281 views

I am looking at the Context Menu demo at http://demos.telerik.com/aspnet-mvc/menu/context-menu

There are several buttons that are part of the context menu such as Reply, Reply All, Forward, etc.  However, they do not do anything so I do not see anything in the demo or anywhere else that demonstrates how you would wire this up to make a working application.

The first thing I am trying to figure out is if you wanted the reply button to work, how would you get the data from the row that the user is clicking on?

I tried something like this:

items.Add()
                .Text("Reply")
                .ImageUrl(Url.Content("~/content/web/toolbar/reply.png"))
                .Items(children =>
                {
                    children.Add().Text("Reply To Sender").ImageUrl(Url.Content("~/content/web/toolbar/reply.png")).Action("Reply", "WebMail", Model);
                    children.Add().Text("Reply To All").ImageUrl(Url.Content("~/content/web/toolbar/reply.png")).Action("ReplyAll", "WebMail", Model);
                });

Of course it doesn't work because Model would refer to the page's model.  How would I pass in data from the model that is applied on the row level?

The row level model for the demo is Kendo.Mvc.Examples.Models.WebMail.  Can you pass in this model or data from this model into the action link so that when the user clicks reply you can get the data for the mail item they clicked on?  Or if you accomplish this via javascript on the select event, is there an example somewhere of how that would be done?

Paul Grothe
Top achievements
Rank 1
 answered on 08 Dec 2015
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
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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?