Telerik Forums
UI for ASP.NET MVC Forum
3 answers
285 views

Hi,

I am expecting a large amount of data to be displayed in the grid and used paging. I tried to use the Kendo.Mvc.Extensions ToDataSourceResult method but don't want to expose my context in the controller. Is there any way to achieve this?

Georgi
Telerik team
 answered on 08 May 2018
2 answers
634 views

Hello!

I've been trying to see if there's a way to set the datasource for in-row filtering? I'm confused since I added the filtering successfully to the in-menu filtering but the in-row just ignores and uses the default grid's datasource to fetch all filter options. Here's an excerpt from a defined column in the grid:

cols.Bound("JobNumber").Title("Job").Filterable(f => f.Multi(true).Search(true).DataSource(ds => ds.Read("JobNumbers", "Filter")));

So the above totally works as expected using the in-menu filtering but the in-row ignores this. Anyway to achieve what I'm looking for? Thanks!

Caleb
Top achievements
Rank 1
 answered on 04 May 2018
2 answers
5.8K+ views

Hello

 

I am trying out Kendo for MVC and I'm having some difficulties with a custom URL action.

Previously I used DataTables in which I had a column for Edit, Details and Delete options which triggers the record to edit and a JavaScript function that initializes a partial view popup where I can edit, view or delete the record.

 

Here is an example of the code from the column inside DataTables that I used:

return '<a href="@Url.Action("Edit", "Country")?id=' + data + '" class="editCountry">Edit</a>;

 

And here is the JavaScript function that us triggered when I click on Edit:

$('#countriesTable').on("click", ".editCountry", function (event) {
 
                event.preventDefault();
 
                var url = $(this).attr("href");
 
                $.get(url, function (data) {
                    $('#editCountryContainer').html(data);
 
                    $('#editCountryModal').modal('show');
                });
 
            });

 

Here is my current code for the edit button inside the Kendo Grid:

columns.Template(@<text>Actions</text>).ClientTemplate("<a href='" + Url.Action("Edit", "Country") + "/#=CountryIdentifier#'>Edit</a>");

 

When I click on the edit button it tries to edit the record on a new page which obviously won't work because I'm using a partial view.

 

How can I trigger the same JavaScript function I used in my DataTables Column inside my Kendo Grid Column?

 

Thanks

Preslav
Telerik team
 answered on 04 May 2018
4 answers
483 views

Hi,

I was trying to frozen my first column on Kendo Grid:

            @(Html.Kendo().Grid<AssortmentResult>()
                            .Name("transomGrid")
                            .Columns(columns =>
                            {
                                columns.Bound(d => d.Style).Width(100).Locked(true).Lockable(false).Filterable(false);
                                columns.Bound(d => d.StyleOption).Width(110).Filterable(false);
                                columns.Bound(d => d.WidthDescription).Title("Width").Width(100).Filterable(true);
                                columns.Bound(d => d.DoorCollectionCode).Width(150).Filterable(true);
                                columns.Bound(d => d.GlassDesign).Width(150).Filterable(true);
                                 columns.Bound(d => d.DealerMarkupWithCommission).Width(150).Filterable(false);
                                columns.Bound(d => d.FlatRate).Width(150).Filterable(false);
                                columns.Bound(d => d.FinalRetailPrice).Width(150).Filterable(false);
                                columns.Bound(d => d.DoubleDeduct).Width(150).Filterable(false);
                            })
                        .DataSource(d => d
                            .Ajax()
                            .PageSize(500)
                            .Read(read => read.Action("DisplayTransoms", "Existing", new { area = "Assortment", assortmentId = (int)ViewData["assortmentId"] }))
                        )
                    .Scrollable(scrollable => scrollable.Height(540))
                    .Reorderable(reorderable => reorderable.Columns(true))
                    .Resizable(resizable => resizable.Columns(true))
                    .Filterable(filterable => filterable
                        .Extra(false)
                        .Operators(operators => operators
                            .ForString(str => str.Clear()
                                .StartsWith("Starts with")
                                .IsEqualTo("Is equal to")
                                .IsNotEqualTo("Is not equal to")
                            ))
                        )
                    .Pageable()
                    .Sortable()

)

But when rendered, the column header of the first column is missing but its content is being displayed which make the header and the content of the grid not even. 

 

Viktor Tachev
Telerik team
 answered on 04 May 2018
1 answer
911 views

Hey folks,

When I export my grid to Excel, the client footer value is formatted as a string (see the Excel image below).

Is it possible to tell Excel that this is a numeric value?

Thanks,

Ken

columns.Bound(e => e.Total).Title("Amount").Width(120).Format("{0:C}").ClientFooterTemplate("#= kendo.format('{0:c}', sum)#");
Alex Hajigeorgieva
Telerik team
 answered on 01 May 2018
4 answers
1.6K+ views

Hi everyone,

I have aproblem with the Kendo UI TreeView and I'm looking for a solution for a while now.

In my view I fill my TreeView like this:

Html.Kendo().TreeView()
                    .Name("treeview")
                    .BindTo((IEnumerable<TreeViewItemModel>) ViewBag.inlineDefault)
                    .Events(events => events
                        .Select("onSelect")
 )
private IEnumerable<TreeViewItemModel> GetDefaultInlineData(ArrayList tables)
        {
            List<TreeViewItemModel> names = tables.Cast<TreeViewItemModel>().ToList();
 
            List<TreeViewItemModel> inlineDefault = new List<TreeViewItemModel>
            {
                    new TreeViewItemModel
                    {
                        Text = "Tables",
                        Items = names
                    }
            };
 
            return inlineDefault;
        }

My onSelect funtion is the following:

<script>
    function onSelect(e) {
        $.ajax({
            type: 'POST',
            url: '/Editor/GetTableContent' ,
            data: { tableName: ?????? },
            success: function (data) {
                $('#table').html(data);
            }
        }).done(function () {
            alert('Done');
        });
    }
</script>

It calls a mehtod in my controller that needs the name of the selected node as parameter (string) to display the content of a table in a grid.

Is there a possibility to get what I need?

Thx for your help!

Erik

Ivan Danchev
Telerik team
 answered on 01 May 2018
3 answers
380 views

Hi,

Please look at the screenshot of the Progress Control Panel and Visual Studio 2017 and let me know why Telerik ASP.NET MVC Application is not showing up in Visual Studio? Do I need to download anything else in the control panel for it to show up?

Thank you.

Nikola
Telerik team
 answered on 30 Apr 2018
2 answers
1.5K+ views

Is it possible to trigger the clear button on a ComboBox?

I'm using $("#ComboBox").data("kendoComboBox").text(''); and $("#ComboBox").data("kendoComboBox").select(-1); to "clear" the input, but the X button is still present when you hover over the input.

Thanks

Ivan Danchev
Telerik team
 answered on 27 Apr 2018
5 answers
756 views

I am attempting to enable server-side filtering for my ASP.NET MVC Grid. I have tried every tutorial, walkthrough, and blog post I could find, but with no success.

I would like to, on page load, call out to my data source and return just the first 25 records, but alert the grid of the total record count so that it can display the appropriate number of pages. Here is my Grid Razor code:

@(Html.Kendo().Grid<ViewModel>().Name("MyGrid").EnableCustomBinding(true).Columns(columns =>
  {
    columns.Bound(c => c.FieldA);
    columns.Bound(c => c.FieldB);
    columns.Bound(c => c.FieldC);
    columns.Bound(c => c.FieldD);
  }).ClientDetailTemplateId("DetailsTemplate").HtmlAttributes(new {@class = "myClass"}).DataSource(dataSource => dataSource
      .Ajax()
      .Read(read => read
        .Action("Data_Read", "MyController"))
    ).AutoBind(false).Events(events =>
    {
      events.DetailCollapse("setDetailIndicatorToExpand");
      events.DetailExpand("setDetailIndicatorToCollapse");
      events.DataBound("replaceDetailTemplateIndicatorStyle");
    }).Pageable().Deferred())

This was done by following this article: http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/binding/custom-binding#configuration-Apply

I have tried many variations of this, including removing AutoBind(). As far as I can tell, part of my issue is that I am not defining what the PageSizes are; whenever I set the PageSizes value I get an error of "Uncaught TypeError: r._query is not a function".

No matter what I try, the page count is always 0.

From the server-side, I am using the PageSize and Page number from the DataSourceRequest object to pass in as parameters to my data source. I am then returning the following:

var result = new DataSourceResult
{
    Data = myData,
    Total = 300 // this is dynamic, just hardcoded here as an example
};
 
return Json(result);

Can someone please assist?

Thank you.

Jesse
Top achievements
Rank 1
Veteran
 answered on 26 Apr 2018
1 answer
189 views

Hi

i am new in Kendo Scheduler.

I am wondering how to have multiple date time picker for startdate and enddate for each employee while adding event.

currently in kendo schedule there is one start and end date for event, but i want to relate it with individual employee to note timing of each employee in one go,

e.g 

while adding an event of type "Staf Meeting"

i want to select timing for each employee. timing could be different for each employee.

can any one help me ?

Veselin Tsvetanov
Telerik team
 answered on 26 Apr 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
DropDownButton
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
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
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?