Telerik Forums
UI for ASP.NET MVC Forum
6 answers
180 views

Hi,

I have 8 (bootstrap) Tabs along with 8 PivotGrids (all with different names/ids, endpoints).

While some of them load correctly some, load the data, but then apply "display:none;" to the columns and rows (see attached).

I don't get any console errors, so not sure why this is happening, other than it doesn't like have 8 on one page?

I tried looking at the RequestEnd callback to maybe remove the "display:none;:" from the tables, but the data that's passed doesn't contain which PivotGrid it's for.

So i'm stuck any recommendations apart form "don't have 8 on one page :P"

Preslav
Telerik team
 answered on 10 Apr 2018
3 answers
492 views
Hi,I have a problem with data binding using a custom template for the editor for the Scheduler component.When double clicking an item in the scheduler my dialog is displayed, for for some reason, I am only able to databind against the properties of the ISchedulerEvent interface and not all the other properties of my ViewModel.ViewModel

Example:
public class MyViewModel : ISchedulerEvent
    {   
        buplic int MyId { get; set;}  
        public bool MyBool{ get; set;}
        public string MyString { get; set; }
        #region ISchedulerEvent
        public string Title { get; set; }
        public string Description { get; set; }
        public bool IsAllDay { get; set; }
        public DateTime Start {get;set;}
        public DateTime End { get; set; }
        public string StartTimezone { get; set; }
        public string EndTimezone { get; set; }
        public string RecurrenceRule { get; set; }
        public string RecurrenceException { get; set; }
        #endregion
}
-----------
View Example:
@(Html.Kendo().Scheduler<MyViewModel>()
      .Name("MyScheduler")
      .Date(DateTime.Today)
      .StartTime(DateTime.Today)
      .EndTime(DateTime.Today.AddYears(1))
      .Views(views =>
      {
          views.DayView();
          views.WeekView(weekView => weekView.Selected(true));
          views.MonthView();
      })
      .DataSource(d =>
      {
          d.Read(read => read.Url("/MyController/MyRead"));
          d.Update(update => update.Url("/MyController/MyUpdate"));
          d.Create(create => create.Url("/MyController/MyCreate"));
          d.Destroy(destroy => destroy.Url("/MyController/MyDelete"));
          d.Model(model =>
          {
              model.Id(f => f.MyId);
          });
      })
      .BindTo(new [] {
                    new ServiceWindowViewModel{
                        MyId = 1,
      MyBool = true,
      MyString = "Yay this is my string",
      
      Title = "title not used",
                        Description = "description not used",
                        End = DateTime.Now.AddHours(2),
                        EndTimezone = null,
                        IsAllDay = false,
                        RecurrenceException = null,
                        RecurrenceRule = null,
                        Start = DateTime.Now,
                        StartTimezone = null
                    }
                })     
      .Editable(editable => {
          editable.Confirmation(true);
          editable.Create(true);
          editable.Destroy(true);
          editable.Resize(true);
          editable.Update(true);
          editable.TemplateId("editor");
        })
    )<script id="editor" type="text/x-kendo-template">
<div class="k-edit-label"><label for="title">Title</label></div>
<div class="k-edit-field" data-container-for="title"><input type="text" class="k-input k-textbox" name="title" data-bind="value: title"></div>
<BR>   
<div class="k-edit-label"><label for="mystring">My String</label></div>
<div class="k-edit-field" data-container-for="mystring"><input type="text" class="k-input k-textbox" name="mystring" data-bind="value: mystring"></div>
</script>
-----------
Now My String editor box is displayed correctly... but the data is not displayed from the property of the view model... what am I doing wrong?Is there some other way to configure a custom edit popup for the Scheduler item? E.g. the editor for the grid seem to work better and is able to display all properties of my ViewModel correctly.Thanks,
Michael
Veselin Tsvetanov
Telerik team
 answered on 10 Apr 2018
1 answer
592 views

When I put a Combobox inside my upload template, it puts a script(Combobox script) within a script (template script).  The browser does not like this and stops rendering correctly.  How do I make this happen?

Thanks

Ivan Danchev
Telerik team
 answered on 09 Apr 2018
3 answers
840 views

I'm attempting to set the filter on some of my columns to Multi, just like the demo at https://demos.telerik.com/aspnet-mvc/grid/filter-multi-checkboxes shows.

I have tried it with and without an ItemTemplate, with and without Search, with and without a BindTo, and just about anything else I can think of.  The filter only ever shows a text box with the button opening a dropdown for equals/contains/starts with/etc, never the checkboxes expected. 

I'm using version 2017.3.1026.

Why does this not work like the demo?

@{Html.Kendo().Grid<PersonGridViewModel>()
    .Name("Grid2")
    .Columns(c =>
    {
        c.Bound(e => e.Race)     .Width(275).Filterable(f => f.Multi(true).Search(true));
        c.Bound(e => e.Ethnicity).Width(225).Filterable(f => f.Multi(true));
        // other columns
    }
    .Filterable(f => f.Mode(GridFilterMode.Row))
    .DataSource(d => d
        .Ajax()
        .ServerOperation(false)
        .Model(m => m.Id(r => r.ID))
        .Read(r => r.Action("action", "controller"))      // Actual names replaced with placeholder
    )
    .Render();
}
Stefan
Telerik team
 answered on 06 Apr 2018
1 answer
705 views

Hi

I see this code:

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Kendo UI Snippet</title>

    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2017.1.223/styles/kendo.common.min.css"/>
    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2017.1.223/styles/kendo.rtl.min.css"/>
    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2017.1.223/styles/kendo.silver.min.css"/>
    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2017.1.223/styles/kendo.mobile.all.min.css"/>

    <script src="http://code.jquery.com/jquery-1.12.4.min.js"></script>
    <script src="http://kendo.cdn.telerik.com/2017.1.223/js/kendo.all.min.js"></script>
    <style>  
      .mySearchIconx {
        background-image: url("http://kendo.cdn.telerik.com/2017.1.223/styles/Bootstrap/sprite.png");
        background-position: -32px -240px;
      }
    </style>
</head>
<body>
  
<button id="button" type="button">Search</button>
<script>
$("#button").kendoButton({
    spriteCssClass: "mySearchIconx"
});
</script>
</body>
</html>

2 Questions

1) How does it know why to show the Search icon? Sprite.png contains a lot of icons? What to change if i want anither icon?

2) My project has a folder structure with "Content\Bootstrap\ in which folder the sprite.png is, i don't want to use

     background-image: url("http://kendo.cdn.telerik.com/2017.1.223/styles/Bootstrap/sprite.png");

but use my own file on disk. I tried a lot of combinations like:

     background-image: url("~\Content\Kendo\Bootstrap\sprite.png");

But i don't get it working

Any help is  appreciated

 

Eric

 

 

 

 

 

Ivan Danchev
Telerik team
 answered on 06 Apr 2018
2 answers
581 views

Hi,

I am having an issue trying to update the parent in a hierarchical grid after making changes in the child.
I am remembering which detail rows have been opened at the time they are opened using the DetailExpand event
I can get the data-uid's of all parent rows without issue.

So then when I update a child I need to refresh the child and also refresh the parent so that some counts are updated.
After the child is updated I call Read on the parent

$('#grid').data().kendoGrid.dataSource.read()


This also works as expected and the parent grid reloads its data with the new counts.
However I then want to re-open detail grids that were open before read was called so the user is back where they were, not be in the default situation that all rows are collapsed again.

I thought I could just call expandRow on the grid for the id(s) that I collected earlier

dataGrid.expandRow(dataGrid.tbody.find("tr[data-uid='" + id + "']"))

 

However the data-uid's for all of the parent rows have now changed making my collection useless.
I thought a slightly more noddy way to do it would be to remember the indexes of the rows that were open but this is no good as the rows can change order upon the data re-loading, those counts that are being updated are used in sorting, so that is no good.

Is there something I can do to keep the data-uid's consistent across calls or some other way of remembering which ones are expanded?

By the way I also tried:

$('#grid').data().kendoGrid.refresh()

 

This allows me to open up the rows that were expanded but it doesn't actually reload the data so the parent counts are not updated...

 

Brian
Top achievements
Rank 1
 answered on 05 Apr 2018
9 answers
778 views

Is there a way to make the value from an autocomplete column not go blank by default when you click the "Edit Button"?

The grid is correctly loading, but when I hit "Edit" instead of defaulting to the value that is loaded for my autocomplete column in "View" mode I get a blank value.

 

    @(Html.Kendo().Grid<CostCenterModel>()
        .Name("settinggrid")
        .AutoBind(true)
        .Editable(editable => editable.Mode(GridEditMode.InLine).DisplayDeleteConfirmation(false))
        .Columns(columns =>
        {
            columns.Bound(c => c.CompositeId).Hidden();
            columns.Bound(c => c.CostCenterOwner.NameAndId).EditorTemplateName("_ucUsersAutocomplete");
            columns.Bound(c => c.CostCenter);
            columns.Bound(c => c.Setting);
            columns.Bound(c => c.SendEmailsFlag).ClientTemplate("<input type='checkbox' # if (SendEmailsFlag) { #" +
                                                                    " checked='checked' " + "# } # onclick='return false' /> ").Title("Send Emails");

            columns.Command(commands =>

            { commands.Edit(); commands.Custom("Delete").HtmlAttributes(new { @class = "k-delete" }).Click("deleteRow"); }
            ).Title("Action").Width("100");

        })

        .ToolBar(toolbar => toolbar.Create().Text("Add New Cost Center Owner"))
        .Scrollable()
        .Sortable()
        .Filterable()
        .ColumnMenu()
        .Resizable(rsb => rsb.Columns(true))
        .Reorderable(r => r.Columns(true))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model =>
            {
                model.Id(c => c.CompositeId); // Specify the property which is the unique identifier of the model.
                model.Field(c => c.CostCenterOwner).DefaultValue(new UserModel());

            })
            .Read(read => read.Action("Settings_ReadCostCenter", "Admin"))
            .Update(update => update.Action("Settings_UpdateCostCenter", "Admin"))
            .Create(create => create.Action("Settings_CreateCostCenter", "Admin"))
            )




    )

Supriya
Top achievements
Rank 1
 answered on 05 Apr 2018
3 answers
254 views

Hello,

We wish to be able to select/deselect the checkbox in the Checkbox selection column on click of the row as well as clicking the checkbox directly.

I can't seem to see any examples of this in your demos.

Thank you

Lucy

Konstantin Dikov
Telerik team
 answered on 04 Apr 2018
1 answer
110 views

I have a Grid, and I have it configured that if I double click a row, it opens an Edit Template.  Upon clicking Update, it would call into the MVC Action corresponding to the Update, and would process.  Today however, it is no longer working.  As far as I'm aware of the only change was to downgrade System.Web.Mvc from 5.2.4 to 5.2.3 because that's what the Kendo.Mvc required.

Using CDN version 2018.1.117.

Here is the code to the grid itself:

@(Html.Kendo().Grid<ClaimsImport>()
      .AutoBind(false)
      .Name("importGrid")
      .Resizable(r => r.Columns(true))
      .Scrollable(s => s.Height("auto"))
      .Sortable()
      .Pageable()
      .Filterable(f => f.Enabled(true))
      .Groupable()
      .Selectable()
      .Events(ev =>
      {
          ev.DataBound("gridBound");
      })
      .Columns(cols =>
      {
          // using a double click to select & edit record cuz I hate how the Telerik Grid buttons look...
          // cols.Command(c => c.Edit().Text(" "));
          cols.ForeignKey(f => f.ImportStatus, (IEnumerable) ViewData["importStatus"], "Value", "Text").Width(150);
          cols.ForeignKey(f => f.Disposition, (IEnumerable) ViewData["dispositions"], "Value", "Text").Width(150);
          cols.Bound(c => c.ClaimId);
          cols.ForeignKey(f => f.ClaimAdminId, (IEnumerable) ViewData["claimAdmins"], "ClaimAdminId", "ClaimAdminName").Width(200);
          cols.Bound(c => c.Carrier);
          cols.Bound(c => c.ClaimNumber);
          cols.Bound(c => c.ClaimantSSN);
          cols.Bound(c => c.ClaimantName);
          cols.Bound(c => c.ClaimStatus);
          cols.Bound(c => c.CloseDate).Format("{0:d}");
          cols.Bound(c => c.DateOfInjury).Format("{0:d}");
          cols.Bound(c => c.Processed).ClientTemplate("#: Processed ? 'Yes' : 'No' #");
      })
      .Editable(e => e.Mode(GridEditMode.PopUp).TemplateName("ClaimImport").Window(w => w.Title("Edit Import Disposition").Width(700)))
      .DataSource(ds => ds
          .Ajax()
          .PageSize(100)
          .ServerOperation(true)
          .Read(r => r.Action("GetImportData", "Claims").Data("addLabelToRead").Type(HttpVerbs.Get))
          .Update(u => u.Action("SaveImportRecord", "Claims").Type(HttpVerbs.Post))
          .Events(ev =>
          {
              ev.RequestEnd("requestEnd");
              ev.RequestStart("requestStart");
              ev.Error("errorHandler");
          })
          .Model(m =>
          {
              m.Id(d => d.ID);
              m.Field(d => d.Disposition);
              m.Field(d => d.ClaimAdminId);
          })
      )
      .ToolBar(tb =>
      {
          tb.Custom().Text("Clear Filter").HtmlAttributes(new {id = "gridFilterReset", style = "float:right;"});
          tb.Custom().Text("Re-Run Claim Match").HtmlAttributes(new { id = "reRunClaimMatch", style = "float:left;" });
          tb.Custom().Text("Update Claim Financials").HtmlAttributes(new { id = "updateClaimFinancials", style = "float:left;" });
      }))

 

Here's the appropriate MVC Action:

public ActionResult SaveImportRecord([DataSourceRequest] DataSourceRequest request, ClaimsImport editedRec)
       {
           ClaimsImport thisRec = WebApiHelper.CallPostAPI<ClaimsImport, ClaimsImport>($"{_baseURL}{_monthEndPath}SaveImportRecord", editedRec);
           return Json(new[] {thisRec}.ToDataSourceResult(request));
       }

 

I have put a break point in the MVC action, and it never gets called.  Never.  I've tried adding an extra javascript function call via the Updates .Data() method, and even it does not get called.  I really need some help with this.

As I said, everything was fine up until today.  Any idea whatsoever about what might be happening.

Joe
Top achievements
Rank 1
 answered on 03 Apr 2018
3 answers
281 views

Hi,

I'm using Bootstraps Tab component with two Tabs: Overview and Under 10K. There is 1 Grid on each Tab. Both load correctly but the one on the non-visible Tab doesn't get rendered correctly, attached a screenshot.

When i resize the view or open debugging tools it then displays correctly, so is there a way i can trigger "re-draw" or "re-size" event?

Thanks,
Lee.

Preslav
Telerik team
 answered on 03 Apr 2018
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
Window
ListView
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?