Telerik Forums
UI for ASP.NET MVC Forum
5 answers
362 views
Hi,

In order to have the same functionality in treelist as in grid we have create a new file where we copied the treelist code and added the required functionality. Now we are thinking maybe we should create a new widget derived from treelist and add the extra functionality. (see https://www.telerik.com/forums/treelist-conditional-filter-functionality and/or https://www.telerik.com/forums/visibility-button-widget---share-code-review!-!)

Since we are using the MVC we were wondering: Can we easily create an MVC wrapper for the new widget? Maybe derived from the treelist wrapper, and just change the widget name to use the new widget name instead of the kendotreelist?

Thank you
Alexandra
Alex Hajigeorgieva
Telerik team
 answered on 18 Dec 2017
2 answers
1.1K+ views

Scenario:

I have a Grid, and a column with text, with inline editing and OnChange event.

User Clicks a cell and the OnChange event it fired

Once clicked, a modal window is opened (Standard Bootstrap)

Question:

How do I update that Cell again from the Modal. How do I pass the ID or context of the Cell down the stack to the Modal Window?

I have seen there is a TR data-uid, but I'm not sure how to get it in the click event or how to select it with the api down the road in the modal.

Stefan
Telerik team
 answered on 18 Dec 2017
1 answer
317 views

Hi!

I would like to use the expandRow(...) function on all of my master-rows in grid. All detail records are loaded via Ajax(...) so I need to wait until each and every detail record is loaded.

My code is simple:

myGrid.expandRow(myGrid.tbody.find("tr.k-master-row"));

 

How can I wait until every row is expanded?

Regards
Heiko

 

 

Stefan
Telerik team
 answered on 18 Dec 2017
5 answers
329 views

I'm using 2017.3.1026, and when I add a column menu to  my grid, in IE 11 (version 11.0.9600.18762CO) the menu showing the sort, filter and column options appears on a click, but the fly-out menus don't appear.

However, loading the page in Chrome, the menus work as they should, showing the filter options, and the columns to show / hide.

Is this a bug, or do I need to do anything to fix this in IE?

AP
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 18 Dec 2017
1 answer
230 views

I have a remote bound grid with a ~1000 row dataset. I have the set the page to refresh the grid every 30 seconds since it is desired to keep the data live.  When the grid does refresh, it takes a few seconds to repopulate. Users find this disrupting as the grid greys out and cannot be scrolled during this time.  Is there a method to refresh the data "in-place"?  Basically in the dataset there may be only 1 or 2 rows that actually change some in the 30s time.  Is there a method to efficiently update the grid only updating the rows that have changed?

Stefan
Telerik team
 answered on 15 Dec 2017
2 answers
156 views

I'm looking at this page http://demos.telerik.com/aspnet-mvc/grid/editing-custom

But there is no editor defined for this control  columns.Bound(p => p.Category).ClientTemplate("#=Category.CategoryName#").Width(180);

It's just the client view template.

Is there a way you could add information to the demo around how the custom editor is working? I see there is a categories viewbag filled with the options but it is never called on the UI or used.

Erik
Top achievements
Rank 2
 answered on 14 Dec 2017
3 answers
821 views

I am trying to export to excel using Kendo Grid with grouping enabled.  

When the data is exported without any grouping applied, the HTML encoding / decoding works as expected and the text is displayed correctly when I open up the spreadsheet in Excel. However when I group by a column whose value contains an apostrophe (or any character needing encoding), the grouped row is exported to excel without decoding the apostrophe which the users find unpleasant.

The grouping row is being auto-generated from Kendo MVC HTMLHelper for Grid and ​after reviewing the documentation regarding limitations around Kendo templates when exporting data to Excel.

What is the correct way to export a grid with grouping enabled -- in particular, how does one use Kendo Export To Excel functionality with grouping row values whose text contains characters ​​that must be HTML encoded? Is this functionality possible by default, or is custom code required to address this scenario when using ASP.NET MVC?

Tsvetina
Telerik team
 answered on 14 Dec 2017
5 answers
776 views

Hi there guys and gals. There appears to be a problem with bool field(check box) in kendo grid. When you click on a bool field, a check box appears and when you click on the check box to change it from true to false and vice versa, it doesn't  change. But when you click on the check box field and then press the space bar, then it changes. This is probably a bug. 

example, try changing the Discontinued field in the grid

Konstantin Dikov
Telerik team
 answered on 14 Dec 2017
5 answers
1.8K+ views

Hi I have issue with displaying dropdownlist [object object]. I tried everyway and even followed some solution in this issue but none worked. Its simple SelectListItem Bind to dropdownlist. Value is loading without any list. when you click it it displays the list but when you select the list item nothing changed and remain as loaded displaying [Object Object]. but how ever Developer toolls shows Dropdownlist value and text field values. Could you please kindly tell me why and where I am wrong. I am new to Kendo but OK with MVC I have used all other dropDownList using Html helper methods even using models, Enums etc. but why this simple Vlaue, text list is not displaying and selecting. but loading perfectly. Please I am really stuck with other places as well with different kendo grid bind to different tables. Please note I am using ADO.NET and stored Proc to retrieve data as I am migrating to MVC. Please see attached images as well. Hope someone will give me solution to this burning issues. -Please note in my Drondownlist editor template, when I used read metid (Line 14 - 17) I get list as 'undefined' without displaying [object object]. its again same SelectListItem only thing is I manually bind to datasource via read method. Do i have to do anything in DropDownChnage event. 

 

My Grid View. 

 

_CategiryGrid.cshtml
 
@model  IEnumerable<StB.ViewModels.CategoryViewModel>
@{
    var imagePath = "~\\Content\\images\\Info.gif";
}
 
@*//   Ajax Grid //   *@
@*@(Html.Kendo().Grid(Model).Name("CategoryGrid")*@
@(Html.Kendo().Grid<StB.ViewModels.CategoryViewModel>().Name("CategoryGrid")
            .Columns(columns =>
            {
                columns.Bound(c => c.ClientCode).Hidden(true);
                columns.Bound(c => c.Category).ClientGroupHeaderTemplate("Category: " + "#= value#").Width(60);
                columns.Bound(c => c.Attribute).Title("Attribute").Width(100);
 
                columns.Bound(c => c.Description).Width(150); //.ClientTemplate(@"<div><img id='tooltipIconItem' src='@imagePath' ToolTip =#:data:ToolTip# /></div>" + @"<div> @Html.Label('fieldValueItem', #:data:Description#)</div>");
 
                columns.Bound(c => c.Required).Width(30); //.ClientTemplate(@"<div><img id='reqEdit' src='~\\Content\\images\\RedStar.gif' /></div>");
 
                columns.Bound(c => c.FieldType).Hidden(true);
                columns.Bound(c => c.DomainID).Hidden(true);            
                columns.Bound(c => c.AttrType).Hidden(true);
                columns.Bound(c => c.Tooltip).Hidden(true);
                columns.Bound(c => c.FieldValue).Width(80).Title("Value").EditorTemplateName("FieldValueEditor").ClientTemplate("#:FieldValue #")
                .HtmlAttributes(new { id = "ddlFieldvalues" }); //.EditorTemplateName("FieldValueEditor");
 
            })
            .Editable(editabel => editabel.Mode(GridEditMode.InCell).Enabled(true))
             .Navigatable()
             .Scrollable()
            .Groupable()
            .Sortable()
            .Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Cell))
            .AutoBind(false)
            .Pageable(pageable => pageable
               
                .ButtonCount(2))
 
           .DataSource(datasource => datasource
               .Ajax()
               .Read(read => read.Action("DisplayGridData", "HierarchyBuilder").Type(HttpVerbs.Post))
               .Update(update => update.Action("UpdateCategory", "HierarchyBuilder"))
               .ServerOperation(false)
               .Batch(true)
               .PageSize(60)
               .Model(model => model.Id(p => p.Attribute))
                   .Model(model =>
                   {
                       model.Field(f => f.Category).Editable(false);
                       model.Field(f => f.Attribute).Editable(false);
                       model.Field(f => f.Description).Editable(false);
                       model.Field(f => f.Required).Editable(false);
                       model.Field(f => f.FieldValue).Editable(true).DefaultValue("1");
 
                   })
               .Aggregates(aggregates => { aggregates.Add(p => p.Category == p.Category).Count(); })
               .Group(groups => groups.Add(m => m.Category))
 
               )
                       .Events(events => { events.Edit("onCategoryGridEdit").DataBound("onCategoryGridDataBound").Change("onCategoryGridChange"); })
       
)
 
@Html.Hidden("ClientCode", HttpContext.Current.Session["ClientCode"])

 

Model for Grid

CategoryViewModel
 
 public class CategoryViewModel
    {
        
        public string OrgCode { get;set;}
        public string SiteCode {get;set;}
 
        public string ClientCode { get; set; }
        public string StructureCode { get; set; }
        public string Category { get; set; }
        public string Attribute { get; set; }
        public string Description { get; set; }
 
        [UIHint("FieldValueEditor")]
        public string FieldValue { get; set;}
 
        public string AttrType { get; set; }
        public string Required { get; set; }
        public int FieldType { get; set; }
        public string DomainID { get; set; }
        public string Tooltip { get; set; }
 
        public IList<DomainViewModel> AllDomains { get; set; }
    }

 

Controller Action method (this is where I get drodowlist as SelectListiem list. I initially directly bound to Domain List and it displays list prefectly but with [object object]. Then I changed to SelectList by creating SelectListItem by reading Domain Model and loading Vlaue text into SelectListItem. I bound to SelectList. Results exactly same. then Finally I chnaged to SelectListItem as show by kendo documentation. Its very simple text value list. and my Grid FieldVlaue in categoryViewModel is string value. 

Below is my controller method 

public IEnumerable<SelectListItem> LoadDropDownlistForValueField(string type, string Client, bool required, string CurrentVal)
       
        {
            StB.DAL.Domain domainRepo = new DAL.Domain();
            List<StB.Models.Domain> domains = new List<Models.Domain>();
            domains = domainRepo.GetDomainValueList(type, Client, CurrentVal, required);
 
            SelectListItem sli = null;
            List<SelectListItem> selectlists = new List<SelectListItem>();
            foreach (var d in domains)
            {
                sli = new SelectListItem() { Text = d.ShortDescription, Value = d.Value, Selected = d.Value == CurrentVal };
                selectlists.Add(sli);
            }
            
 
            ViewData["FieldValueList"] = selectlists;
            return (System.Collections.Generic.IEnumerable<SelectListItem>)ViewData["FieldValueList"];
        }

 

 

below is my DropDownList editor template for my Grid column.

01.@(Html.Kendo().DropDownList()
02.            .Name("FieldValue")     
03.            .HtmlAttributes(new { id = "ddlFieldValues" })           
04.            .ValuePrimitive(true)       
05.            .DataTextField("Text")
06.            .DataValueField("Value")
07. 
08.            .AutoBind(false)
09. 
10.            .Events(e => e.Change("onFiledVaueDropDownChange").DataBound("onFiledVaueDataBound"))
11. 
12.                .BindTo((IEnumerable<SelectListItem>)ViewData["FieldValueList"])
13. 
14.                //.DataSource(datasource =>
15.                //{
16.                //    datasource.Read(read => read.Action("LoadDropDownlistForValueField", "HierarchyBuilder").Data("additionalInfo('CategoryGrid')"));
17.                //})
18. 
19.)

 

 

Dimitar
Telerik team
 answered on 13 Dec 2017
2 answers
462 views

Hi,

I am trying to change the ItemTemplate for a Multiselect which is used inside a CustomEditorTemplate for a Kendo Scheduler. 

The multiselect is initialized as follows:

<code>

@(Html.Kendo().MultiSelectFor(model => model.Predavatelji_Ids)

          .HtmlAttributes(new { data_bind = "value:Predavatelji_Ids" })
          .Name("Predavatelji_Ids")
          .DataValueField("Id")
          .DataTextField("Ime")
          .Filter("contains")
          .AutoBind(true)
          //.Value(Model.Predavatleji)

          .DataSource(source =>
          {
              source.Read(read =>
                  read.Action("Avtorji_Dropdown", "Avtorji").Data("additionalInfo")
                  )
                .ServerFiltering(true);
          }).Events(e => e.Open("validatePredmentInput"))
           .ItemTemplate("<span class=\"k-state-default\"><h3>#: console.log(data) #</h3><p>#= data.Ime #</p></span>")
    )

</code>

But calling the data object inside the ItemTemplate returns the Model object for the current Scheduled event and not the Multiselect item.

What am I missing?

 

Dimitar
Telerik team
 answered on 13 Dec 2017
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?