Telerik Forums
UI for ASP.NET MVC Forum
7 answers
494 views
When I filter a text column in the MVC grid, the sql that gets sent to SQL server is using the "lower" function to perform case-insensitive search. However, SQL Server already does case insensitive comparisons and the call to lower prevents from the index on that column to be used.

Example of SQL being sent to SQL Server:

SELECT [Extent1].[ID] AS [ID], [Extent1].[Capture Date] AS [Capture Date], [Extent1].[Item Sequence Number] AS [Item Sequence Number], 
        FROM [dbo].[Images] AS [Extent1]
        WHERE ((LOWER([Extent1].[Account Number])) = (LOWER('112233'))) OR ((LOWER([Extent1].[Account Number]) IS NULL) AND (LOWER('112233') IS NULL))

I am using hte latest version of Telerik UI for MVC and EF 6. The datasource code in the controller is:

public ActionResult Images_Read([DataSourceRequest]DataSourceRequest request)
{
    return this.Json(this._repository.Images.ToDataSourceResult(request));
}

Can I prevent Telerik's grid from using t-sql's lower function?
Tsvetina
Telerik team
 answered on 27 Feb 2018
6 answers
868 views
It would be nice if we had some more real business sample apps.  I see there are a few examples on git hub but are quite limited.  There is a mention of a Northwind Sample coming which would be more useful.    Something with a fair few linking tables,  some lookup lists, CRUD forms.   There are of course different samples online here but not too many actual complete MVC examples.  Most examples have blank MVC controllers!!.  So im not sure about anyone else but I have to then try to implement these examples using MVC with entity framework sending data to the view and back to the controller.  This usually involves a lot of head scratching and trail and error before i manage success.   

If i click on http://www.telerik.com/aspnet-mvc then click on Demos it takes me to the Kendo demos which has examples for ASP.net and MVC with razor syntax etc, but when i click on documentation all this has gone and all the documentation is in the plain html syntax with no mention of MVC.  

The Sample Kendo apps apps websushi, aeroviewr are nice and pretty.  The ASP.NET sample salesdashboard is basiclly lets see how many pretty visual elements we shove into one page.  The WPF Sample apps are the same.   But your tools are used for more than just pretty websites and sales dashboards with loads of graphs and charts.   They are also used for boring financial applications with lots of basic but very different types of data entry forms.  The meat and potatoes of business applications.  Show us how to build these apps too.  The bootstrap example page would be quite useful if you turned it into an MVC sample application with full CRUD forms etc.   Nothing too complicated just something like using he Northwind or Adventure Work databases (or one of your own).   This would i'm sure save people a  lot of time.

Thanks


Misho
Telerik team
 answered on 27 Feb 2018
1 answer
209 views

Trying to accomplish a simple task, after loading I want to set the map extent based on the marker layer.

I have the code to create the extent and set it but timing is the issue. When I try to do this on document ready the layer item list is empty and there is no explicit "load" event I can attach a handler to. Firing on "reset" will cause infinite recursion since the function is itself changing the viewport of the map plus it seems to fire multiple times.

Basically, I just need to know when this should be called and how to wire a handler to do it at that time.

var map = $('#map').getKendoMap();
var layer = map.layers[1];
var markers = layer.items;
var extent;
 
for (var i = 0; i < markers.length; i++) {
  var loc = markers[i].location();
  if (!extent) {
    extent = new kendo.dataviz.map.Extent(loc, loc);
  } else {
    extent.include(loc);
  }
}
 
map.extent(extent);

.

 

Preslav
Telerik team
 answered on 26 Feb 2018
1 answer
544 views
Hello,

I would like to implement a vertical menu and for the child or sub menus
have them pull down like an accordion style rather than flyout.

Is this possible or does anyone have an example I can look at?, its so fantastic if I can achieve with Kendo.Menu

Thanks.
Ivan Danchev
Telerik team
 answered on 26 Feb 2018
3 answers
518 views
I have code on window :

.Events(events => events.Open("WindowToCenter"))

and javascript:

function WindowToCenter() {
 
        var window = $('#windowEditArticle').data("kendoWindow");
        window.center();
    }

Problem is that .center() working only first time. When I open window next time window position is total wrong.

Any idea?
Ivan Danchev
Telerik team
 answered on 23 Feb 2018
3 answers
578 views

Hello,

I am stacked with this problem since 4 days.

I have two treeviews, the data of the first one is retrieved from my database as bellow :

@(Html.Kendo().TreeView()
                  .Name("treeview-left")
                  .Events(events => events
                  .DragEnd("HierarchyDragEnd"))
                  .HtmlAttributes(new { style = "height: 100%;" })
                  .DataTextField("name")
                  .DragAndDrop(true)
                  .DataSource(source => source
                      .Model(m => m
                          .Id("itemId")
                          .HasChildren("haschildren")
                          )
                      .Read(read => read
                          .Action("GetCatalog", "ItemsSelection")))
                          .ExpandAll(true)
            )

and the second treeview is empty, but i need to drag and drop items on it from the first tree and save in database :

 

@(Html.Kendo().TreeView()
                 .Name("treeview-right")
                 .Events(events => events
                 .DragEnd("HierarchyDragEnd"))
                 .HtmlAttributes(new { style = "height: 100%;" })
                 .DragAndDrop(true)
                 .DataTextField("name")
                 .DataSource(source => source
                             .Model(m => m
                                 .Id("itemId")
                                 .HasChildren("haschildren")
                                 )
                             )
 
                 )

 I use the script bellow to get the information from the first tree  but the script works just in case if i do drag and drop in the same tree:

function HierarchyDragEnd(e) {
        setTimeout(function () {
            var originDataItem = $("#treeview-left").data('kendoTreeView').dataItem(e.sourceNode);
            var originNodeId = originDataItem.id;
            var originNodeText = originDataItem.name;
 
 
            var destinationDataItem = $("#treeview-right").data('kendoTreeView').dataItem(e.destinationNode);
            var destinationNodeId = destinationDataItem.id;
            var destinationNodeText = destinationDataItem.name;
            destinationDataItem.add(originDataItem);
            var dropPosition = e.dropPosition;
 
            alert("Origin ID: " + originNodeId +
                                "\nOrigin Text: " + originNodeText +
                                "\nDestination ID: " + destinationNodeId +
                                "\nDestination Text: " + destinationNodeText +
                                "\nDrop Position: " + dropPosition);
        }, 100);
    }

 

Can someone pease help me to get all the information i need to save the dropped items in my database, maybe i am not using the right events or something else.

 

Thank you for your help.

Ivan Danchev
Telerik team
 answered on 22 Feb 2018
3 answers
256 views

<script id="SCTemplate" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<SCVM>()
          .Name("grid_#=SCartID#") // template expression, to be evaluated in the master context
          .Columns(columns =>
          {
              columns.Bound(c => c.ci.SCID).Hidden().HtmlAttributes(new { @id = "SCID" });
              columns.Bound(c => c.ci.FN).Title("Name");
              columns.Bound(c => c.ci.IN).Hidden(true);
              columns.Bound(c => c.ci.FN).Title("Item Number").Width(150);
              columns.Bound(c => c.ci.IsDO).Title("Order Type").ClientTemplate("#if(convertToBoolean(cosci)){#<span class='glyphicon glyphicon-envelope'>hello</span#}#").HtmlAttributes(new { @class = "js-bl" }) ;

 

 

The above is a code snippet from a Hierarchical Grid Template. What I am attempting to do is show an icon based on the value of "cosci". The issue is, this value is null. The type of this object is string. But when the page is hit, the value is gone. My Previous attempts had me set the object type to boolean. In all cases, it always came back as null. Interestingly enough, the c.ci.IsDO is "true", and it's type is boolean. Is it possible to have conditional statements in a child template? Please provide source files or a link to documentation that will shed light on the issue; but not http://demos.telerik.com/aspnet-mvc/grid/, as that link does not address the issue. 

FWIW, the convertToBoolean is a function I was using in attempt to change the types to achieve my desired result(s), this fails, because the sequence in which the objects are loaded into the DOM is unexpected.

 

Thanks.

Angel Petrov
Telerik team
 answered on 22 Feb 2018
1 answer
204 views

I am trying to enable range filtering using the EnableRangeFiltering property on a Grid column. The ShippedDate column in the following example demonstrates how to do it using webforms and server side binding, but I need an example using Razor and Ajax client side binding.

https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/basic-filtering/defaultcs.aspx?show-source=true

Can you point me in the right direction?

Georgi
Telerik team
 answered on 22 Feb 2018
3 answers
843 views
I have a grid with an image column to show if there is an error or not.  If this is an error, I would like to display a tooltip with a message when the user hovers over the image.  The message would be from c.ErrorMessage.

Is there a sample on how to do this?  I searched and could not find one.

@(Html.Kendo().Grid<GridLineItem>().Name("grid").Columns(columns =>
              {
                    columns.Bound(c => c.ReportName).Title("Status").ClientTemplate(
                        "# if (HasError == true) { #" +
                            "<img src='" + Url.Content("Images/error.png") + "'/>" +
                        "# } else { #" +
                              "<img src='" + Url.Content("Images/success.png") + "'/>" +
                        "# } #"
                    );
                                )
Stefan
Telerik team
 answered on 22 Feb 2018
7 answers
935 views
Hello!
I have grid, which contains ClientDetailTemplateId("//here template with Grid -> " MyGridChild"...
If I create new object in MyGridChild, I want get Id him Parent 
Please help

Stefan
Telerik team
 answered on 22 Feb 2018
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
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?