Telerik Forums
UI for ASP.NET MVC Forum
4 answers
1.0K+ views
Hi, is there a direct way to turn off autocomplete on filter without having to use some sort template?  The hack work-around I'm playing around with at the moment is setting MinLength to a unrealistic amount so the autocomplete never fires off.

columns.Bound(m => m.UserName).Title("User Name").Width(115).Filterable(f => f.Cell(c => c.Operator("contains").ShowOperators(false).MinLength(5000)));
Alexander Popov
Telerik team
 answered on 04 Feb 2016
3 answers
121 views

I am try to create a simple diagram, indicating the position of a record within a workflow. All I need is a line of different coloured circles, appropriately coloured, along with a label.

I have managed most of this, however the connectors, rather than linking to the circles, always use the text blocks to link to, meaning the lines are never straight, and not connected to the shapes.

How can I force the connectors to link to the shapes, and ignore the text?

I've attached a screenshot of the result I currently get.

 

Below is the page code:-

 

@{
    ViewBag.Title = "Index";
}
 
<h2>TEST</h2>
 
<script>
    function visualTemplate(options) {
        var dataviz = kendo.dataviz;
        var g = new dataviz.diagram.Group();
        var dataItem = options.dataItem;
 
 
        g.append(new dataviz.diagram.Circle({
            width: 50,
            height: 50,
            fill: dataItem.Colour,
            stroke: {
                width: 0
            }
        }));
 
 
        g.append(new dataviz.diagram.TextBlock({
            text: dataItem.PositionName,
            x: 60,
            y: 20,
            color: "black"
        }));
 
 
        return g;
    }
 
</script>
 
 
 
<div>
 
 
    @(Html.Kendo().Diagram()
      .Name("diagram")
      .DataSource(dataSource => dataSource
          .Read(read => read
              .Action("GetWFData", "Test")
          )
          .Model(m => m.Children("Items"))
      )
      .Editable(false)
      .Pannable(false)
      .Zoom(0)
      .Layout(l => l.Type(DiagramLayoutType.Layered))
      .ShapeDefaults(sd => sd
          .Visual("visualTemplate")
      )
      .ConnectionDefaults(cd => cd
          .Stroke(s => s
              .Color("#979797")
              .Width(2)
          )
      )
    )
 
 
 
 
</div>

 

Thanks

AP
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 03 Feb 2016
1 answer
649 views

Hi Team, Below is my requirement.
In a page,I have multiple KENDO MVC Grids where in some of grids i have Add & Update commands. I need to display Confirm Model dialog before submitting the row to controller. I didnt find any events to do this.

Please help. Thanks. Below is my MVC grid code 

@(Html.Kendo().Grid<iMAP.SRT.Core.SRTPRODUCT>().Name("SRT").Columns(columns =>{ columns.Command(command => { command.Edit(); }).HeaderHtmlAttributes(new { @class = "headercolumn" }).Width(130); columns.Bound(c => c.ACTIVE).Title("ACTIVE").HeaderHtmlAttributes(new { @class = "headercolumn" }).ClientTemplate("<input type='checkbox' #= ACTIVE ? checked='checked' :'' # />").Width(60); columns.Bound(c => c.CODE).Title("PRODUCT CODE").HeaderHtmlAttributes(new { @class = "headercolumn" }).Width(120); columns.Bound(c => c.DESCR).Title("DESCRIPTION").HeaderHtmlAttributes(new { @class = "headercolumn" }).Width(360);}).ToolBar(toolbar => { toolbar.Create(); })//.ToolBar(toolBar => toolBar.Template(@"<a id='addSome' class='k-button k-button-icontext k-grid-add' onclick='PDSBOMResults();'><span class='k-icon k-add'></span>Add new record</a>")).Editable(editable =>{ editable.Mode(GridEditMode.InLine).Window(window =>{ window.HtmlAttributes(new { @class = "k-window-titlebar;k-window-title;k-grid-update;k-grid-cancel;k-window-action;k-icon k-update;" });});}).Editable(editable => editable.Mode(GridEditMode.InLine)).HtmlAttributes(new { style = "height:500px;" }).Groupable().Scrollable(scrollable => scrollable.Virtual(true)).Selectable(selectable => selectable .Mode(GridSelectionMode.Multiple)).Filterable()//.Filterable(ftb => ftb.Mode(GridFilterMode.Row)).Resizable(resize => resize.Columns(true)).Events(x => x.Edit("popupProductsModule").DataBound("onGrisDataBound"))//.Events(events => events.Edit(@<text>function (e) {if (e.model.isNew() == false) {$("#CODE").attr("readonly", true);$("#CREATED").attr("hidden", true);$("#CREATEDBY").attr("hidden", true);$("label[for='CREATED']").attr("hidden", true);$("label[for='CREATEDBY']").attr("hidden", true)}}</text>)).DataSource(dataSource => dataSource .Ajax().Events(events => events.RequestEnd("onRequestEndForProducts")).Model(model =>{ model.Id(p => p.PRODUCTID); model.Field(p => p.CODE).Editable(true);}).Create(update => update.Action("InsertKBProducts", "SrtProject").Data("passParamsForInsertKBProducts")).Read(read => read.Action("GetKBProducts", "SrtProject").Data("getMainProductdetailsParams")).Update(update => update.Action("UpdateKBProducts", "SrtProject").Data("passParamsForUpdateKBProducts")).Destroy(update => update.Action("DeleteKBProducts", "SrtProject"))))

Boyan Dimitrov
Telerik team
 answered on 03 Feb 2016
1 answer
125 views

Hi,

Can a bar chart have multiple bars on a single line?  (Note: the letters represent bars)  If so, is there an example?

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

    |         xxxxxxx                          yyyyyyyyy                  zzz

    |     aaaa         bbbbb                                       ccccc

    |                                            wwwwwwwwwwwwwwwwwwwwwww

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

Thanks

Scott

 

 

Danail Vasilev
Telerik team
 answered on 03 Feb 2016
1 answer
131 views

Hi I need a column.which needs to be editable in inline edit mode and should be non editable at insert mode.As well we need to have two different list in either case.in insert mode only filtered list should be shown and in edit mode all record should be shown in grid columns dropdown.

Maria Ilieva
Telerik team
 answered on 02 Feb 2016
2 answers
254 views

Hi ,

          I just updated my libraries to the latest one  2016.1.112.545 and now  the bottom border of an input widget is missing at a particular zoom level in Chrome browser but it works fine in IE and Firefox. Any help appreciated. 

 

Thank you

 

 

Pavlina
Telerik team
 answered on 02 Feb 2016
6 answers
876 views

 Below is code where I am trying to create master detail grids where data is fed through list of objects. When I run it I do get master detail grids, but when I try to do sorting, filtering, paging, I lose my page and I am sent back to home page. And If I use alternate DataSource code as below I get error "Cannot use only server templates in Ajax or WebService binding mode. Please specify a client template as well."

Please advice. Thanks. 

My model is something like this

 public partial class Invoice
    {
        public int InvoiceNumber{ get; set; }

..

..

   public List<IvDetail> IvDetails { set; get; }
}   

 

And here is view code.

 

@model IEnumerable<Portal.Models.Invoice>

@{ Html.Kendo().Grid(Model)
    .Name("InvoiceGrid")
            .Pageable()
            .Columns(columns =>
            {
                columns.Bound(p => p.InvoiceNumber).Filterable(true).Title("Invoice Number");
                columns.Bound(p => p.InvoiceDate).Title("Invoice Date");
                columns.Bound(p => p.InvoiceTotal).Title("Invoice Total");
                columns.Bound(p => p.Balance).Title("Balance");
            })
            .Filterable()
            .Sortable()
            .Navigatable()
            .DataSource(dataSource => dataSource.Server().PageSize(15))

            // this gives error "Cannot use only server templates in Ajax or WebService binding mode. Please specify a client template as well."
            //.DataSource(datasource => datasource
            //    .Ajax()
            //    .PageSize(15)
            //    .ServerOperation(false)
            //    .Sort(sort =>
            //    {
            //        sort.Add(p => p.InvoiceNumber);
            //    })
            // )
            .DetailTemplate(
                @<text>           
                    @(Html.Kendo().Grid(item.IvDetails)
                            .Name("IvDetails_" + item.InvoiceNumber)
                            .Columns(columns =>
                            {
                                columns.Bound(o => o.ItemNumber);
                                columns.Bound(o => o.PartNumber);
                                columns.Bound(o => o.Description);
                            })
                            .DataSource(dataSource => dataSource.Server().PageSize(15))                    
                            .Pageable()
                            .Sortable()
                            .Filterable()
                    )
                </text>
    )
    .Sortable() 
    .Render();

Boyan Dimitrov
Telerik team
 answered on 02 Feb 2016
2 answers
163 views
I've got a grid that I need to select a color criteria for the data.  I've created a Custom Model that uses the ColorPickerFor component and when in the color cell the colorPicker appears and I can select a color.  When I tab off of the cell the color value is displayed as "#fff111" or whatever color I selected.  I don't want to display the values in the grid like that but want to display them as a square color swatch showing the color even when the cell is not in edit mode.  How can you accomplish this.  I've been fiddling with ClientTemplate and I can't seem to get the background-color to work.
Dimiter Madjarov
Telerik team
 answered on 02 Feb 2016
2 answers
84 views

Hi everyone,

 

I'm trying to add an EditorTemplate for an autocomplete column.  However, when I add the template, the only way for the grid to get populated is to select from the dropdown.  If I don't select from the dropdown, then the autocomplete does not populate the grid column with the text.  My code is below.   Any help is much appreciated.  Thank you for your time.

 

Bret Mullinix

 

Column From Grid -->


columns.Bound(l => l.AssetObject).Width(200)
                                        .ClientTemplate(" #: data.AssetObject ? data.AssetObject.SerialNumber : getSerialNumber(this, data) #" +
                                                        "<input type='hidden' name='ShipmentItems[#= index(data)#].AssetObject.AssetTypeId' " +
                                                            " value=' #: data.AssetObject ? data.AssetObject.AssetTypeId : '[None]' #' /> " +
                                                        "<input type='hidden' name='ShipmentItems[#= index(data)#].AssetObject.SerialNumber' " +
                                                            " value=' #: data.AssetObject ? data.AssetObject.SerialNumber : '[None]' #' /> " +
                                                        "<input type='hidden' name='ShipmentItems[#= index(data)#].AssetObject.Id' " +
                                                        "value='#: data.AssetObject ? data.AssetObject.Id : 0 #' />" +
                                                        "<input type='hidden' name='ShipmentItems[#= index(data)#].AssetObject.Responsible' " +
                                                        "value='#: data.AssetObject ? data.AssetObject.Responsible : '' #' />" +
                                                            "<input type='hidden' name='ShipmentItems[#= index(data)#].AssetObject.Disposition' " +
                                                        "value='#: data.AssetObject ? data.AssetObject.Disposition : '' #' />" +
                                                        "<input type='hidden' name='ShipmentItems[#= index(data)#].AssetObject.ResponsibleId' " +
                                                        "value='#: data.AssetObject ? data.AssetObject.ResponsibleId : 0 #' />" +
                                                            "<input type='hidden' name='ShipmentItems[#= index(data)#].AssetObject.DispositionId' " +
                                                        "value='#: data.AssetObject ? data.AssetObject.DispositionId : 0 #' />" +
                                                            "<input type='hidden' name='ShipmentItems[#= index(data)#].AssetObject.OwnerId' " +
                                                        "value='#: data.AssetObject ? data.AssetObject.OwnerId : 0 #' />"
                                        )
                                        .EditorTemplateName("AssetSerialNumberAutoComplete");

EditorTemplate:  AutoSerialNumberAutoComplete

@using Kendo.Mvc.UI
@using DataTransferObjects
@model AssetDTO
@(Html.Kendo().AutoComplete()  
        .Name("AssetSerialNumberAutoComplete")
             
          .DataTextField("SerialNumber")
          .Events(e => e.Change("onSerialNumberChange"))     
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("GetAssetBySerialNumber", "Asset").Data("onAdditionalDataForAssetSerialNumber");
              });
               source.ServerFiltering(true);
               
          })
              .HtmlAttributes(new { style = "width:100%", data_skip = "false", data_bind = "defferedValue: AssetObject" })
          .Filter("startswith")
          .MinLength(2)
          .Height(400)
         
               .HeaderTemplate("<div class=\"col-sm-12\">" +
                        "<div class=\"col-sm-6\">SerialNumber</div>" +
                        "<div class=\"col-sm-6\">Asset Type</div>" +
                    "</div><br/>")
              .Template("<div class=\"col-sm-12\">" +
                      "<div class=\"col-sm-6\">#: data.SerialNumber #</div>" +
                        "<div class=\"col-sm-6\">#: data.AssetType #</div>" +
                        "</div>")
          
)
 
<script>
 
    var autoComplete = $("#AssetSerialNumberAutoComplete").data("kendoAutoComplete");
    autoComplete.list.width(600); //adjust width of the drop-down list
 
</script>

Bret
Top achievements
Rank 1
 answered on 01 Feb 2016
6 answers
1.7K+ views

There are several topics on this forum regarding linking Grid columns to Dictionary properties. I've managed to do just that, but these columns are missing sorting and dropdown menu.

My model represents an issue from issue tracking system that may have very different fields depending on particular configuration. I can't see it feasible to define each possible property for my model class and the only logical solution is to have direct properties for most common fields and have a Dictionary for custom fields.

 

I'm using Kendo.MVC version 2016.1.112 in MVC 6 / .NET 5 project (which currently doesn't support server-side binding as far as I understand - rendering some solutions posted on this forum inapplicable). Browser is Chrome, but it doesn't seem the issue relates to browser version.

 

My model class is as follows:

public class Issue
{
    public string Key { get; set; }
    public string Summary { get; set; }
    public string Status { get; set; }
    public string StatusType { get; set; }
    public DateTime? Created { get; set; }
    public DateTime? LastUpdated { get; set; }
 
    public Dictionary<string, object> CustomProperties { get; set; } = new Dictionary<string, object>();
}

 

The Grid is then defined in View's *.cshtml file as this:

@(Html.Kendo().Grid<JIRAReports.Models.Issue>()
  .Name("grid")
  .HtmlAttributes(new { style = "margin-top: 10px;" })
  .DataSource(dataSource => dataSource.Ajax()
                                      .Sort(sort => sort.Add("LastUpdated").Ascending())
                                      .Read(read => read.Action("JiraIssues_Read", "Reports"))
                                      .PageSize(15)
 
              )
  .Columns(columns =>
  {
    columns.Bound(issue => issue.Key).Width(120).HtmlAttributes(new { style = "white-space: nowrap;" })
      .ClientTemplate($"<a href=\"{baseIssueUrl}#=Key#\" target=\"_blank\">#=Key#</a>");
    columns.Bound(issue => issue.Status).Width(150)
      .ClientTemplate(statusColumnTemplate);
    columns.Bound(issue => issue.Summary).HtmlAttributes(new { style = "white-space: nowrap;" });
    columns.Bound(issue => issue.LastUpdated).Width(180).HtmlAttributes(new { style = "white-space: nowrap;" })
      .Title("Last Updated").Format("{0:M/d/yyyy (ddd)}");
    //Adding custom properties
    columns.Template("#:CustomProperties['CustomProperty1']#").Title("Custom Property 1");
    columns.Template("#:CustomProperties['CustomProperty2']#").Title("Custom Property 2").Hidden();
  })
  .Pageable(config => config.PageSizes(new[] { 10, 15, 25, 100 })
                            .Refresh(true))
  .Sortable(config => config.AllowUnsort(false).SortMode(GridSortMode.MultipleColumn))
  .Scrollable(config => config.Height("895px"))
  .Resizable(config => config.Columns(true))
  .ClientDetailTemplateId("item-template")
  .ToolBar(tools => tools.Custom().Text("Expand All").Name("ExpandAll"))
  .ToolBar(tools => tools.Custom().Text("Collapse All").Name("CollapseAll"))
  .NoRecords()
  .ColumnMenu()
  .Reorderable(config => config.Columns(true))
  .Deferred()

 

The resulting grid is rendered as on the screenshot attached. You can see there is no dropdown next to columns linked to Dictionary's items, they are not sortable, but these columns do appear in dropdowns for other columns so they can be shown/hidden. But sorting on them is absolutely required.

 

Please suggest a solution. There must be a way to link to less structured data or indexer property, especially since all we need is to display it in read-only mode.

Siarhei
Top achievements
Rank 1
 answered on 01 Feb 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
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
Iron
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
Iron
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?