Telerik Forums
UI for ASP.NET MVC Forum
3 answers
630 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
143 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.5K+ 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
214 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
151 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
710 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
4 answers
637 views

Approved is a DateTime in my model. approvedDate is a Datetime variable in my Razor view.

I want to test Approved to see if it is before approvedDate and replace it with a empty string "" if it is inside the x-kendo-template detail-template.

 @{ var approvedDate = DateTime.Parse("01-01-2016"); }

 <script id="detail-template" type="text/x-kendo-template">

    <ul>

        < li>#if (# #= Approved # # < @approvedDate) {# ""#}else{# #= kendo.toString(Approved, "MM-dd-yyyy") # #}#</li>

     </ul>

</script>

 The above syntax causes the detail-template script to fail.

What is the syntax to make this if statement work?

 

 

 

Joe
Top achievements
Rank 1
 answered on 25 Jan 2016
3 answers
158 views

Hi,

 

When I expand a combobox and scroll through the options, when I reach the end of the list (can't scroll further) and I continue scrolling anyway, it will close the combobox and scroll the entire page instead. This makes it very difficult to scroll through the combobox, as it regularly closes by accident. This happens when either scrolling up or down.

 

Weird thing is, The demos on http://demos.telerik.com/aspnet-mvc/combobox/index don't have this issue for me. Clearly something is different for me, but I tried replicating the exact same combobox as on the Demo, and this still happens. I hope someone recognizes this issue and/or can give me some insight as to why this happens.

 

Thanks!

 

Tim

Viktor Tachev
Telerik team
 answered on 25 Jan 2016
1 answer
137 views

Hi,

Q: Is server validation possible with WebAPI as DataSource and Kendo UI grid?

Situation: First, the model for the gid contains an attributed field "required". But the grid doesn't do any validation for this field. The Web API POST request is happening when this field still empty (even the validation warning isn't displaying (DisplayMessage)).

Then, inside the WebAPI request at the server-side, the returned object is 'HttpResponseMessage'. So how can i trigger the grid that the validation is false (ModeState.IsValid == false). 

 I known the exiting of a returned object DataSourceResult with second parameter 'ModelStateDictionary', but this expect the ModelStateDirectory of a MVC controller and not from an API Controller.

So the goal is, how can I do a validation on grid inline edition submit with Web API?

Dimiter Topalov
Telerik team
 answered on 25 Jan 2016
6 answers
389 views

Hi,

I would like to implement the following behavior:

When I click to expand a tree node, I would like the expanding node to scroll to the top of the treeview.  I did this once a long time ago with an ASP.NET treeview control, but that was before the days of MVC, etc.

 Please see the two attached before and after views.  That should explain what I need to do.

Thanks in advance.

 Ken.

Nencho
Telerik team
 answered on 25 Jan 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
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
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?