Telerik Forums
Kendo UI for jQuery Forum
2 answers
1.2K+ views

Hey there guys, I've spent a good amount of time looking through other people's issues for this problem and haven't found it addressed yet.

Basically the problem I'm experiencing is trying to create an extension method to HtmlHelper (which works fine), but for some reason setting up corrected operators on filterable is causing issues. Here the code I am trying to use:

public static GridBuilder<T> ExtensionGrid<T>(this IHtmlHelper<dynamic> helper, string name)
            where T : class
        {
            return helper.Kendo().Grid<T>()
                .Name(name)
                .Filterable(filterable => filterable
                    .Extra(false)
                    .Operators(operators => operators
                        .ForString(str => str
                            .Clear()
                            .Contains("Contains")
                            .DoesNotContain("Does not contain")
                            .StartsWith("Starts with")
                            .EndsWith("Ends with")
                            .IsEqualTo("Is equal to")
                            .IsNotEqualTo("Is not equal to ")   // <== trailing space is intentional.
                        )
                    )
                )
                .Pageable(pager => pager
                    .ButtonCount(5)
                    .PageSizes(new int[] { 5, 10, 20, 50, 100, 150, 200 })
                    .Input(true)
                    .Refresh(true)
                )
                .Sortable(sortable => sortable
                    .Enabled(true)
                    .AllowUnsort(false)
                )
                .Events(events =>
                {
                    events.FilterMenuInit("trapKendoGridFilterEnterKey");
                });
        }

I can see the UI responding to the Extra(false) piece, but not to the ForString() piece (still just seeing the default string operators). I also see the same behavior when I apply it directly to a grid like this:

@(Html.Kendo().Grid<Role>()
            .Name("RoleGrid")
            .Columns(columns =>
            {
                columns.Bound(c => c.RoleId)
                    .Hidden(true);
                columns.Bound(c => c.RoleCode);
                columns.Bound(c => c.RoleName);
                columns.Bound(c => c.RoleDescription);
                columns.Bound(c => c.RoleDisplayOrder);
            })
            .Filterable(filterable => filterable
                .Extra(false)
                .Operators(operators => operators
                    .ForString(str => str
                        .Clear()
                        .Contains("Contains")
                        .DoesNotContain("Does not contain")
                        .StartsWith("Starts with")
                        .EndsWith("Ends with")
                        .IsEqualTo("Is equal to")
                        .IsNotEqualTo("Is not equal to ")
                    )
                )
            )
            .Scrollable()
            .Selectable()
            .Sortable()
            .Pageable(pageable => pageable
                .ButtonCount(5)
                .PageSizes(new int[] { 5, 10, 20, 50, 100, 150, 200 })
                .Input(true)
                .Refresh(true)
            )
            .DataSource(dataSource => dataSource
                .Ajax()
                .Model(model =>
                {
                    model.Id(m => m.RoleId);
                    model.Field(m => m.RoleId).Editable(false);
                })
                .Events(events => events
                    .Error("ajaxErrorHandlerForGrid('RoleGrid')")
                )
                .Read(read => read.Action("Role_Read", "Shared"))
            )
        )

 

The only time I do see it working is with a row level filter such as this:

@(Html.Kendo().Grid<Role>()
            .Name("RoleGrid")
            .Columns(columns =>
            {
                columns.Bound(c => c.RoleId)
                    .Hidden(true);
                columns.Bound(c => c.RoleCode)
                    .Filterable(f => f.Extra(false).Operators(o => o.ForString(str => str.Clear().Contains("Contains"))));
                columns.Bound(c => c.RoleName);
                columns.Bound(c => c.RoleDescription);
                columns.Bound(c => c.RoleDisplayOrder);
            })
            .Filterable(filterable => filterable
                .Extra(false)
                .Operators(operators => operators
                    .ForString(str => str
                        .Clear()
                        .Contains("Contains")
                        .DoesNotContain("Does not contain")
                        .StartsWith("Starts with")
                        .EndsWith("Ends with")
                        .IsEqualTo("Is equal to")
                        .IsNotEqualTo("Is not equal to ")
                    )
                )
            )
            .Scrollable()
            .Selectable()
            .Sortable()
            .Pageable(pageable => pageable
                .ButtonCount(5)
                .PageSizes(new int[] { 5, 10, 20, 50, 100, 150, 200 })
                .Input(true)
                .Refresh(true)
            )
            .DataSource(dataSource => dataSource
                .Ajax()
                .Model(model =>
                {
                    model.Id(m => m.RoleId);
                    model.Field(m => m.RoleId).Editable(false);
                })
                .Events(events => events
                    .Error("ajaxErrorHandlerForGrid('RoleGrid')")
                )
                .Read(read => read.Action("Role_Read", "Shared"))
            )
        )

 

I have tried setting the GridFilterMode to menu, but that didn't cause any change. And I'm using the latest release of Telerik.UI.for.AspNet.Core (2017.1.118), the project type is .NET Core with .NET Framework, and it is using similar code to a .NET Framework project that currently works fine. Is this functionality that is no longer supported or is there a new way to implement it that I am missing?

Thanks for the help.

Konstantin Dikov
Telerik team
 answered on 06 Apr 2017
3 answers
259 views

Hi folks,

I try to use the noDataTemplate as mentioned in example on "http://demos.telerik.com/kendo-ui/autocomplete/addnewitem" for adding new items if they not exist in data source. The data source in my case is a local one, NOT using remote data. My application is running with angular and I use the autocomplete inside an angular controller, NOT as angular directive. Inside the loaded template I try to use a scope function of my angular controller, to trigger the new item adding.

Now at run time, the template is inserted into the DOM at the end of the body not inside my controller area, where the autocomplete is located.

 

Now the problem is, that the scope function is not found in template. Is there any other approach or what is my mistake by initializing the autocomplete control?

 

Thx and 

kind regards

Danny

Dimitar
Telerik team
 answered on 06 Apr 2017
1 answer
552 views

OK I give in... how do you add items to a Sortable Dynamically?  

 

Also, is it possible to temporarily hide items?

 

And can a sortable be generated from an array/datasource?

Stefan
Telerik team
 answered on 06 Apr 2017
1 answer
277 views

I would like to remove the "Add" button on my kendo grid and instead have a permanently available add row at the bottom of the grid.  When the user clicks the update button in that grid it would fire the create command and add the row.

 

It looks like i can set the insert row to the bottom by using: 

.Editable(e => e.Mode(GridEditMode.InLine).CreateAt(GridInsertRowPosition.Bottom))

I then tried to make the add row visible by using the following code

.Events(e => e.DataBound("Adjustment_Bound"))

<script type="text/javascript">
    function Adjustment_Bound() {
        var grid = $("#Adjustment-grid").data("kendoGrid");
        grid.addRow();
    }
 
</script>

 

This however locked up the browser,  I am guessing because the addRow() causes the databound to get refired.

 

TIA,

Logan

Konstantin Dikov
Telerik team
 answered on 06 Apr 2017
2 answers
383 views
Hello everyone,
I am new here and i don't know how to add extra fields in scheduler popup edit form. I want to add some text fields (like Title), textarea fields (like Description).
Can you please help me.
Joan
Top achievements
Rank 1
 answered on 05 Apr 2017
4 answers
509 views

We're revamping our toolbars, which you might have guessed by the volume of questions I'm posting on this forum.  In the past, we have often put kendoMenu controls within a kendoToolBar.  We've been able to make that work, but we've had to implement work arounds, especially when it comes to things like 508 compliance - feedback, keybinding - and we've also had issues with overflow not working properly.  We've ended up not using overflow as a result and now we want responsive toolbars.

 

I'm just wanting to touch base and see if kendoMenu within kendoToolBar is more fully supported in the most recent version of kendo.  And if not, is there a recommended way of dealing with hierarchical data within a toolbar?

Larissa
Top achievements
Rank 1
 answered on 05 Apr 2017
5 answers
1.7K+ views

I am using ASP.NET MVC for grid. @(Html.Kendo().grid().

 

I have a column, which is a date data type. I want to have a date range filter for this column. I cannot find any related tutorial about it. Please advise.

Dimiter Topalov
Telerik team
 answered on 05 Apr 2017
2 answers
126 views
Hi, I'm new to Kendo UI

I'm facing the problem in Spreadsheet when Tool tip  is used with filter is applied for particular range tool tip is not working for each cell.

(I've specified the link here) http://dojo.telerik.com/oLOHA/11 In this link tool tip is not working( for  1st column till 15th row) so I'm not getting the solution for this please guide me about this...
Vinay Kiran S
Top achievements
Rank 1
 answered on 05 Apr 2017
4 answers
537 views

I have referenced Telerik.Web.Spreadsheet.dll and want to import an uploaded xslx to a spreadsheet in a asp.net mvc view.

I'm following this demo: http://demos.telerik.com/aspnet-mvc/spreadsheet/server-side-import-export

My code:

        [HttpPost]
        public ActionResult Upload(HttpPostedFileBase file)
        {
            var workbook = Telerik.Web.Spreadsheet.Workbook.Load(file.InputStream, Path.GetExtension(file.FileName));
            return Content(workbook.ToJson(), Telerik.Web.Spreadsheet.MimeTypes.JSON);
        }

 

The line " var workbook = Telerik.Web.Spreadsheet.Workbook.Load(file.InputStream, Path.GetExtension(file.FileName));" throws the following error:

InnerException    {"Could not load file or assembly 'Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml, Version=2017.1.109.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The system cannot find the file specified.":"Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml, Version=2017.1.109.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7"}    System.Exception {System.IO.FileNotFoundException}

 

then I add Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.dll and get a similar exception for Telerik.Windows.Documents.Core.dll.

then I add Telerik.Windows.Documents.Core.dll and get a new exception type:

($exception).InnerException    {"Could not load file or assembly 'Telerik.Windows.Documents.Core, Version=2017.1.109.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Telerik.Windows.Documents.Core, Version=2017.1.109.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7"}    System.Exception {System.IO.FileLoadException}

 

What dll's must I reference (and how) in a asp.net mvc project?

/Morten

 

 

Nencho
Telerik team
 answered on 05 Apr 2017
8 answers
536 views

HI,

I am new to Kendo Mobile. 

I have some below queries. 

1. How to get the swipe direction (Left/Right) of scroll view?

2. In my scenario, I am binding ScrollView with dynamic data by fetching a single item at a time. I am re-binding the same template with received data. How can i achieve paging (prev/next functionality) with the same approach? 

3. Due to dynamic data, ScrollView doesn't maintain screen height properly. If data is large it hides some content if I hard code the height. How to resolve this?

Please could you answer above mentioned queries?

Thanks in advance.

 

Tsvetina
Telerik team
 answered on 04 Apr 2017
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?