Telerik Forums
UI for ASP.NET MVC Forum
3 answers
879 views
 I try to make a grid hierarchy. I have two grids. One of them is inside of the other. Parent grid reads the data via ajax read method. Returning json result has a field of a list. I want to use this list for populating the inner grid. But i get an error of Cannot use only server templates in Ajax or WebService binding mode. Please specify a client template as well.
@(Html.Kendo().Grid<Customers>().Name("grid")
    .Scrollable()
.Pageable().Columns(columns =>{         columns.Bound(o => o.CompanyName);         columns.Bound(o => o.ContactName);}).DetailTemplate(@<div>@(Html.Kendo().Grid<Phones>(item.Phones).Name("g" + item.ID).Scrollable().Pageable().Columns(columns =>{                         columns.Bound(o => o.Number);}))</div >).DataSource(datasource => datasource
        .Ajax().Read(read => read.Action("GetCustomers", "Home", new { x = "asd"}))))

I dont want the inner grid read via ajax. I want it to use the list field of returning json.
Radoslav
Telerik team
 answered on 27 Jan 2016
9 answers
1.9K+ views

Hi Everybody, 

 I have an ASP.NET MVC site, when I do some Razor code to add a Dropdownlist to the view. 

 I have the following code in my cshtml file for generating the Dropdown and it works fine.

                        <div class='col-md-8'>
                            @(Html.Kendo().DropDownListFor(m => m.CountryCode)
                            .DataTextField("Text").DataValueField("Value").
                                AutoBind(true).DataSource(dataSource => dataSource.Read(read =>
                                { read.Action("GetCountries", "Member"); })).Events(f => f.DataBound("OnDataBound")))
                            @Html.ValidationMessageFor(m => m.CountryCode)
                        </div>

 

The output in IE 11

<span tabindex="0" title="" class="k-widget k-dropdown k-header" role="listbox" aria-busy="false" aria-disabled="false" aria-expanded="false" aria-haspopup="true" aria-readonly="false" aria-activedescendant="e8e82663-3c75-4f99-9459-7b7a41945db1" aria-owns="CountryCode_listbox" unselectable="on">
<span class="k-dropdown-wrap k-state-default" unselectable="on">
<span class="k-input" unselectable="on">Danmark</span><span class="k-select" unselectable="on">
<span class="k-icon k-i-arrow-s" unselectable="on">select</span></span></span><input name="CountryCode" tabindex="8" class="k-valid" id="MedlemLandekode" style="display: none;" type="text" value="Danmark" data-role="dropdownlist" data-val-required="Feltet er påkrævet" data-val="true"></span>
<script>
    jQuery(function(){jQuery("#MedlemLandekode").kendoDropDownList({"dataBound":OnDataBound,"dataSource":{"transport":{"read":{"url":"/Felix.ASPNet.MVC/Medlem/GetCountries"},"prefix":""},"schema":{"errors":"Errors"}},"dataTextField":"Text","autoBind":true,"dataValueField":"Value"});});
</script>
                             
<span class="field-validation-valid" style="display: none;" data-valmsg-replace="true" data-valmsg-for="CountryCode"></span>

I can see that my top element has tabindex = 0 instead of tabindex =8, this is avoiding me to tab into the dropdown list

Dimo
Telerik team
 answered on 27 Jan 2016
8 answers
987 views

Hi,

I'm trying to migrate my old gantt component for the telerik MVC gantt,
but I need to know if is possible to add new custom fields per task,
because the old one component handle more fields, like critical task, priority, status and attached files for each task, and I want to conserve these fields.

If it's possible, how to do that?.

Thanks,

Regards.

BuildBinder
Top achievements
Rank 1
 answered on 26 Jan 2016
7 answers
1.0K+ views
How to display tooltip when mouse hover over the Kendo MultiSelectFor and DorpDownlistFor controls in MVC?

Please provide the sample code.
Julien
Top achievements
Rank 1
 answered on 26 Jan 2016
3 answers
654 views

Hi all -

I'm using MVC5/EF6 along with JQuery, Bootstrap, and Kendo UI for MVC .NET. I have a grid setup that works perfectly in a normal view, using AJAX clientside binding. No issues.

However, I need to use this same grid within a partial view. When I use the EXACT same code, the client side functions no longer work in the grid (i.e. Filtering, Paging, Date Picker, etc.). The one function that does work is the Sort (???). 

After digging around for a day, I think I saw somewhere that I may need to add specific Kendo JS scripts to my partial view to get things to work again. Unfortunately, I cannot find that page now that things make more sense.

So - let me ask here:

What do I need to do to get the Kendo MVC Grid client side functions to work inside a Partial View? Again, everything works inside a normal View using client side ajax configuration (the controller sends back JSON, etc.). The exact same code and client side ajax configuration is not fully functional in a Partial View.

Please advise. Thanks in advance!

Alexander Popov
Telerik team
 answered on 26 Jan 2016
1 answer
149 views

I am curious about the timing of events for the TreeView and the Datasource.

 I am trying to scroll a Treeview control's contents so that the expanded event is scrolled to the top.  I have gotten this to work for the most part.  You can read my solution in another thread.  However, I am seeing the TreeView's Expand event fire before the datasource RequestStart and RequestEnd events.

This order does not seem to make sense.  My scrolling of the treeview's selected node malfunctions periodically because the expand event fires first, before the datasource returns the data for the expanded node.  This results in the scrolling not happening at all sometimes if returning the data takes a while.

Is this design intentional?  If so, is there a way around it?  If Javascript were multi-threaded, I could easily get around this but I cannot seem to come up with a way to get around this problem.

I would like to delay the Expand event until after the datasource RequestEnd event.

Possible?

Nencho
Telerik team
 answered on 26 Jan 2016
1 answer
1.6K+ views

Hello

 I know that I can get all items on page by the following:

 

var grid = $("#grid").data("kendoGrid");
        console.log(grid.dataitems());

 

If I apply a filter on the columns then the above code will only print the items returned after filtering.

 

 Now my question is how do I get all the dataitems from all the pages, both before and after filtering?

Konstantin Dikov
Telerik team
 answered on 26 Jan 2016
1 answer
222 views

Hello

 

I have just adopted Telerik and have been having great success with it but now I want a very important functionality for my grid. 

After enabling Groupable() for my grid, I would like to have a checkbox in the group header to select all items in that group that is until next group header. And once selected I would like to invoke an action on the selected data on button click. 

Please help regarding this functionality.

  

Regards

Boyan Dimitrov
Telerik team
 answered on 26 Jan 2016
4 answers
171 views

My grid shows as empty with the following code.

<!-- jQuery JavaScript -->
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<h2>Country Grid</h2>
@(Html.Kendo().Grid<MACore.Models.Configuration.Geographic.Location.Country>()
    .Name("gridname")
    .Columns(columns => {
        columns.Bound(p => p.CountryID);
        columns.Bound(p => p.Description);
        columns.Bound(p => p.LongDescription);
    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:550px;" })
    .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("Countries_Read", "Country"))
            .PageSize(20)
     )
)

The "Countries_Read" does supply a list of Countries when used with other code....any suggestions? 

Hristo Valyavicharski
Telerik team
 answered on 25 Jan 2016
1 answer
728 views

I'm generating a grid using ToDataSourceResult(), and I pass an IQueryable to that. LINQ to Entities doesn't support anything like ToLocalTime(), so how can I perform that conversion?

The property is a DateTime type in MVC, and it displays in the grid accordingly. If I specify to use a time in addition to the date, it uses the raw UTC value pulled from the DB (as expected). How can I convert it to local time, either server-side with the DataSourceResult or client-side with the grid itself or manipulating it using jQuery?

Viktor Tachev
Telerik team
 answered on 25 Jan 2016
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?