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

Hi.  I have a filter in place and I change it at times in js like this.

var ds = $("#scheduler").data("kendoScheduler").dataSource;
           ds.filter([
               {
                   "logic": "or",
                   "filters": [
                       {
                           "field": "OwnerID",
                           "operator": "eq",
                           "value": 1
                       },
                       {
                           "field": "OwnerID",
                           "operator": "eq",
                           "value": 2
                       },
                       {
                           "field": "OwnerID",

In my popup custom edit window I have a dropdown with OwnerID values 1 to 8.

I want the dropdown to show only one default value if my filter is for only 1 value.

My problem is how to read/get data from the current filter.

function filterdata() {
        var scheduler = $("#scheduler").data("kendoScheduler");
        var dataSource = scheduler.dataSource;
        var filters = dataSource.filter();
        alert(filters);  //  this returns the the text "Object"
 
 
      return {
            dept: 2
      };
    }

 

So...  How can I get and check the array values of the filter object?

Thanks

 

Rick Hubka
Top achievements
Rank 1
 answered on 26 Oct 2017
1 answer
108 views

https://docs.telerik.com/aspnet-mvc/getting-started/asp-net-mvc-5

 

Everytime I try to setup a project using Kendo UI with MVC5 the above link never works. I follow it step by step. I just want to setup a project smoothly. 

Dimitar
Telerik team
 answered on 26 Oct 2017
3 answers
115 views

Hi,

unfortunately after upgrading to the latest Version my application has serveral errors. The reason seems to be a bug in server-filtering.

Try

https://demos.telerik.com/aspnet-mvc/grid/serverbinding

Filter column product ID = 1 => It works

Then filter column product ID = 1 OR product ID = 2 => Error

The internal error is a NullReferenceException (see attach file).

Not so good...

Bye, Michael

 

Pavlina
Telerik team
 answered on 26 Oct 2017
2 answers
546 views

I have the Column Menu on my grid to allow users to lock some columns.  However, when I use the columnMenu the filter option shows with the arrow next to it but the sub menu for the filter does not show at all.  Any idea what I am doing wrong? I am using version 2017.3.913.

Here is my grid code:

@model IEnumerable<Saturn.Models.ListData>
<div class="BordRSolThin">
@(Html.Kendo().Grid(Model)
.Name(componentName: "EditGrid")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action(actionName: "EditGrid_Read", controllerName: "List")
.Data("getEditData"))
.PageSize(pageSize: 500)
)
.Columns(columns =>
{
columns.Command(command => command.Custom(name: "Edit").Click(handler: "editRevision")).Width(pixelWidth: 75).Locked(true).Lockable(false);
columns.Bound(p => p.CoreID).Title(text: "CoreID").Width(pixelWidth: 100);
columns.Bound(p => p.ProjID).Title(text: "ProjID").Width(pixelWidth: 100);
columns.Bound(p => p.ListRev).Title(text: "ListRev").Width(pixelWidth: 100);
columns.Bound(p => p.SYSID).Title(text: "SYSID").Width(pixelWidth: 100).Locked(true).Lockable(true);
columns.Bound(p => p.FGrp).Title(text: "FGrp").Width(pixelWidth: 300);
columns.Bound(p => p.REDUND).Title(text: "REDUND").Width(pixelWidth: 100);
columns.Bound(p => p.NAME).Title(text: "NAME").Width(pixelWidth: 550).Lockable(true);
columns.Bound(p => p.PlanName).Title(text: "PlanName").Width(pixelWidth: 250).Lockable(true);
columns.Bound(p => p.BarrelType).Title(text: "BarrelType").Width(pixelWidth: 100).Lockable(true);
columns.Bound(p => p.TickNo).Title(text: "TickNo").Width(pixelWidth: 100);                                
                            })
.Pageable(pageable => pageable
.Input(enabled: true)
.Numeric(enabled: false)
.Refresh(enabled: true)
)
.Sortable()
.ColumnMenu()
.Scrollable(scr => scr.Height(pixelHeight: 700))
.Selectable()
.Filterable()
)
</div>

 

 

 

Richard
Top achievements
Rank 1
 answered on 25 Oct 2017
1 answer
337 views

I am creating a Kendo grid with a datetime column. I want to group the date column so that it is descending. The latest date is on top and the earliest on the bottom. I have come across this line of code

groups => groups.AddDescending(true)

 

But it says that there is no definition for AddDescending. How do I change the grouping? Here is how my grid is defined.

@(Html.Kendo().Grid<LogModel>()
            .Name("Log")
            .Columns(columns =>
            {
                columns.Bound(m => m.dateTimeChangeDate)
                    .Title("Date and Time")
                    .ClientTemplate("#= ChangeDate#")
                    .ClientGroupHeaderTemplate("#= formatUtcDateToLocal(value,  'MM/DD/YYYY')#")
                    .Width("12%");
                columns.Bound(m => m.Component)
                    .Title("Component")
                    .Width("8%")
                    .Filterable(filterable => filterable
                        .UI("componentFilter")
                        .Extra(false)
                        .Operators(operators => operators
                            .ForString(str => str.Clear()
                            .Contains("Contains")
                         ))
                );
                columns.Bound(m => m.Action)
                    .Title("Action")
                    .Width("15%")
                    .Filterable(filterable => filterable
                        .UI("actionFilter")
                        .Extra(false)
                        .Operators(operators => operators
                            .ForString(str => str.Clear()
                            .Contains("Contains")
                        ))
                     );
                columns.Bound(m => m.Changer)
                    .Title("Changer")
                    .Width("10%");
                columns.Bound(m => m.Identifier)
                    .Title("On")
                    .Width("15%");
                columns.Bound(m => m.OldValue)
                    .Title("Old Value")
                    .Width("20%");
                columns.Bound(m => m.NewValue)
                    .Title("New Value")
                    .Width("20%");
            })
            .Filterable()
            .Selectable()
            .Sortable()
            .Groupable()
            .Resizable(resize => resize.Columns(true))
            .ToolBar(toolbar =>
            {
            toolbar.Template(
                @<text>
                    <a class="k-button k-button-icontext k-grid-excel" href="#"><span class="k-icon k-i-excel"></span>Export to Excel</a>
                    <span style='padding-left:35%;font-weight:bold;padding-top:7px'>@ViewBag.ProjectNumber</span>
                    <span style='float:right;font-weight:bold;padding-top:7px'>Total: <span id="change-log-record-count">@ViewBag.ChangeLogRecordAmount</span> records</span>
 
                </text>
                );
            })
            .Excel(excel => excel.AllPages(true).FileName(@ViewBag.ChangeLogType + " Change Log " + @ViewBag.ProjectNumber + ".xlsx").Filterable(true))
            .DataSource(dataSource => dataSource
                 .Ajax()
                 .Model(model =>
                 {
                     model.Id(p => p.Id);
                 })
                 .Read(read => read.Action("FetchChangeLogData", "ChangeLog")
                 .Data("buildParam"))
           )
           .Events(e => e.FilterMenuInit("resizeFilter")
                         .ExcelExport("modifyFormatForExcel")
                         .DataBound("preselectCustomFilter"))
           .ClientDetailTemplateId("change-log-details-template")
    )
Stefan
Telerik team
 answered on 25 Oct 2017
3 answers
517 views

How can we select the node that is clicked on by a right click event?  I am trying to pass the selected node's id on a context menu select event but unless the user left clicks on the node to select it first, the last selected node information gets sent, if one was even selected.

This may be fairly basic, but I can't find any examples of this.

Thanks.

Neli
Telerik team
 answered on 25 Oct 2017
3 answers
562 views

Hi Telerik,

 

I want to know how to add a TreeView inside DropDownList with MVC like your demo in ASP.NET AJAX http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/treeviewcombobox/defaultcs.aspx?product=treeview

 

Can you please help me to resolve this issue?
Thanks

Ivan Danchev
Telerik team
 answered on 24 Oct 2017
1 answer
668 views

I have a tabstrip that loads its content from partial views, and this works well provided the routeValues never change. For example:

@(Html.Kendo().TabStrip()
    .Name("MyTabStrip")
    .Items(i =>
    {
        i.Add().Text("First Tab").LoadContentFrom("FirstAction", "MyController", new { id = ViewData["id"]  });
        i.Add().Text("Second Tab").LoadContentFrom("SecondAction", "MyController", new { id = ViewData["id"] });
    })
)

This will hit FirstAction and SecondAction when the tabs are selected, and carry the id along from ViewData, this is fine.

...but if "id" is a more dynamic bit of data, that needs to change on the page, this approach is no longer valid.  

The TabStrips do not have any Data function, akin to what can be found in the Read attribute in a regular DataSource, which would have been nice, and there is nothing too helpful in the Select event of the TabStrip. I have tried editing the _contentUrls list inside the TabStrip element, but this does not seem to work, either; it seems this is populated when the element is created, but not actually used.

...so how can this be done? Is there any way to update the content urls of an existing tab?

Ivan Danchev
Telerik team
 answered on 24 Oct 2017
8 answers
538 views
Hi, 

Can Grid Hierarchy handle Batch Edit?
Kindly provide sample codes if there is..

Thanks..
Konstantin Dikov
Telerik team
 answered on 23 Oct 2017
1 answer
1.3K+ views

I need to add a horizontal scrollbar at the top of the kendo grid. I've attached a screenshot of what I'd like to be able to do.

 

Thanks

Stefan
Telerik team
 answered on 23 Oct 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?