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

Hi All,

 

I am using Kendo MVC subgrid with client template, and initially its working fine but since few days back subgrid is not loading any data.

Here is my code for Grid. In my case when expanding sub grid its loading column but not the data and also dont seen any event for data load. 

 

<h3 class="nvs">Search Results</h3>
   @(Html.Kendo().Grid<DealInfo>()
         .Name("SalesGrid")
         .Columns(columns =>
         {
         columns.Template(@<text></text>).ClientTemplate("<input type='checkbox' class='master'/>").Width(30);
             columns.Bound(e => e.Nbr).Title("Nbr").Width(160);
             columns.Bound(e => e.Name).Title("Name");
             columns.Bound(e => e.Name1).Title("Name1");
             columns.Bound(e => e.JobTYpe).Title("JobType");
         })
         .Sortable()
         .Scrollable()
         .ClientDetailTemplateId("template")
         .DataSource(ds => ds
             .Ajax()
             .PageSize(10)
             .Read(r => r.Action("Action", "Controller").Data("jsview.GetSearchCriterion"))
         )
         .HtmlAttributes(new { style = "height:500px;" })
         .Pageable(p => p
             .Numeric(true)
             .PageSizes(new[] { 10, 20, 50 })
             .PreviousNext(true)
         )
   )
   <div>
       <script id="template" type="text/kendo-tmpl">
 
           @(Html.Kendo().Grid<DealOrdersModel>()
                         .Name("grid_#=Nbr#") // template expression, to be evaluated in the master context
                         .Columns(columns =>
                         {
                             columns.Bound(o => o.OrderNbr).Title("Order Number").HeaderHtmlAttributes(new { style = "white-space:normal" });
                             columns.Bound(o => o.Date).Title("Date").Format("{0:MM/dd/yyyy}").HeaderHtmlAttributes(new { style = "white-space:normal" });
                             columns.Bound(o => o.Type).Title("Type").HeaderHtmlAttributes(new { style = "white-space:normal" });
                             columns.Bound(o => o.Type1).Title("Type1").Width(110);
                         })
                         .DataSource(dataSource => dataSource
                             .Ajax()
                             .PageSize(5)
                             .Read(read => read.Action("Action1", "Controller", new { Nbr = "#=Nbr#" }))
                         )
                         .Pageable()
                         .Sortable()
                         .ToClientTemplate()
           )
 
 
       </script>
 
   </div>
chintan
Top achievements
Rank 1
 answered on 14 Nov 2016
1 answer
106 views

Hi,
I'd like to know how can I show DropDownList as the default control type for specific column in GridView control on its initial loading instead of showing the default label in each row for specific column.
I'm using in-cell edit mode and I followed your demos to show DropDownList for specific column by using ClientTemplate and ForeignKey Column Type ..Its working good, However, I'd like to show this DropDownList always for this columns in all rows in GridView initial loading not only when focus on the related cell.

MyView:

 

@(Html.Kendo().Grid<GIWebDemoApp.Models.ViewModels.ProductCategoryViewModel>()<br>    .Name("grid")<br>    .Columns(columns =><br>    {<br>        columns.Bound(p => p.ProductName);<br>        columns.Bound(p => p.Category).ClientTemplate("#=Category.CategoryName#").Width(160);<br>        columns.Bound(p => p.UnitPrice).Width(120);<br>        columns.Command(command => command.Destroy()).Width(90);<br>    })<br>    .ToolBar(toolBar =><br>        {<br>            toolBar.Create();<br>            toolBar.Save();<br>        })<br>    .Editable(editable => editable.Mode(GridEditMode.InCell))<br>    .Pageable()<br>    .Sortable()<br>    .Scrollable()<br>    .HtmlAttributes(new { style = "height:430px;" })<br>    .DataSource(dataSource => dataSource<br>        .Ajax()<br>        .Batch(true)<br>        .ServerOperation(false)<br>        .Events(events => events.Error("error_handler"))<br>        .Model(model =><br>        {<br>            model.Id(p => p.ProductID);<br>            model.Field(p => p.ProductID).Editable(false);<br>        })<br>        .PageSize(20)<br>                .Read(read => read.Action("GetAllProductsAndRelatedCategories", "Product"))<br>                .Create(create => create.Action("AddProductsAndRelatedCategories", "Product"))<br>                .Update(update => update.Action("UpdateProductsAndRelatedCategories", "Product"))<br>                .Destroy(destroy => destroy.Action("RemoveProductsAndRelatedCategories", "Product"))<br>    )<br>)

-----------------------------------------------

<p>public ActionResult Manage()        </p><p>{            </p><p>PopulateCategories();  </p><p>          return View();        </p><p>}</p>

      private void PopulateCategories()<br>        {<br>            var dataContext = new NORTHWNDEntities();<br>            var categories = dataContext.Categories<br>                        .Select(c => new CategoryViewModel<br>                        {<br>                            CategoryID = c.CategoryID,<br>                            CategoryName = c.CategoryName<br>                        })<br>                        .OrderBy(e => e.CategoryName);<br><br>            ViewData["categories"] = categories;<br>      <br>        }

 

     

Eyup
Telerik team
 answered on 14 Nov 2016
3 answers
111 views
Hi! Is there a way to move the shapes in the diagram with the arrow keys? Or I'd need to do it myself capturing key events and moving the selected shapes?
Vessy
Telerik team
 answered on 14 Nov 2016
1 answer
995 views

I'm working with Kendo UI on an MVC application. We have a grid and when the user opens the row for editing we have a dropDownList that holds company names. I'm trying to get the DDL to default to the company name that's pertinent to the row.

Here's the column code:

columns.Bound(e => e.company_business_name).Width(220).Title("Company")
    .EditorTemplateName("CompanyName");

and here's the editorTemplate code:

 

@model  string
 
@(Html.Kendo().DropDownListFor(m => m)
        .DataTextField("Text")
        .DataValueField("Value")</p><p>
        .BindTo((System.Collections.IEnumerable)ViewData["Companies"])
 )

and the method that fills the DDL:

private void PopulateCompanies()
    {
        var companyList = new List<SelectListItem>();
 
        if (!string.IsNullOrEmpty(Session["Companies"] as string))
        {
            companyList = (List<SelectListItem>)Session["Companies"];
        }
        else
        {
            companyList = new DataAccess().GetCompanies(CurrentSettings.getUser().userId);
            CacheCompanies(companyList);
        }
 
        ViewData["Companies"] = companyList;

}

The dropDownList is populating, and displays when I click edit, but the selected value is blank.  How can I set it to the value that was in the grid when it was in display mode?

Ivan Danchev
Telerik team
 answered on 11 Nov 2016
5 answers
228 views
Hi,

I am having an issue with Dropdown list templates/value templates when used inside an editor popup called from a grid.  The code, when applied to a standard view works well.

Is this a known issue?

Regards,
Mike
Peter Milchev
Telerik team
 answered on 11 Nov 2016
6 answers
792 views

Hello,

I want to create a helper method that wraps a Kendo UI widget as described here:
http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/faq#how-to-create-helper-methods-rendering-predefined-widgets-i-can-further-configure

using Kendo.Mvc.UI;
using Kendo.Mvc.UI.Fluent;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
 
namespace Gpdb.Helpers
 
{
    public static class HtmlHelperExtensions
 
    {
        public static GridBuilder<T> MyKendoGrid<T>(this HtmlHelper helper, string name)
            where T : class
        {
            return helper.Kendo().Grid<T>()
                .Name(name)
                .Groupable()
                .Pageable()
                .Sortable()
                .Scrollable()
                .Filterable()
                .Pageable();
        }
    }
}

but this doesn't work because of the following error (see attached Picture) - what I'm missing?

Danail Vasilev
Telerik team
 answered on 11 Nov 2016
2 answers
2.4K+ views

The grid below defaults to 10 records per page.  Is there a way to change this value?

Thanks!

    @(Html.Kendo().Grid(Model).Name("Orders").Columns(c =>
{
    c.Bound(m => m.WORK_ORD_NO);
    c.Bound(m => m.WMS_STATUS);
    c.Bound(m => m.WO_STATUS);
    c.Bound(m => m.LINKED_ORDER);
    c.Bound(m => m.ASSIGNED_TO);
    c.Bound(m => m.SHIPPER_NO);
    c.Bound(m => m.QUANTITY);
    c.Bound(m => m.REQ_SHIP_DATE);
    c.Bound(m => m.EST_SHIP_DATE);
    c.Bound(m => m.ACT_SHIP_DATE);
})
    .Sortable()
    .Filterable()
    .Pageable()
    .Groupable()
    )


Chris
Top achievements
Rank 1
 answered on 10 Nov 2016
3 answers
137 views

Hi,

Why isn't it possible to disable/hide the ColumnMenu on specific columns like Filterable or Sortable i.e. ColumnMenu(false)

robert

Vessy
Telerik team
 answered on 10 Nov 2016
2 answers
194 views
VS2015 keeps nagging me to update my project with the latest version of Telerik MVC. Currently I'm using 2016.2.607. I got tired of the nagging, so I used the Upgrade wizard, and absolutely nothing in my code worked anymore.  It was by far one of the most horrible upgrade experiences.  What is the best way to update this to the latest version without having to basically re-write everything?
Dyanko
Telerik team
 answered on 10 Nov 2016
1 answer
353 views

I have a grid that has an option to export in PDF, how can i export the pdf calling a report of telerik?

The thing is that when i click the button on to export in PDF i want that the export to be with the report of telerik that i made with the telerik reports designer.

is that possible?

I hope someone can help me.

Big hugs.

Stef
Telerik team
 answered on 10 Nov 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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
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
+? 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?