Telerik Forums
UI for ASP.NET MVC Forum
1 answer
637 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
906 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
764 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
656 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
828 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
380 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
148 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
326 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
3 answers
145 views

Hi, 

I'm trying to make scheduler in which you could remove group like in example(https://demos.telerik.com/aspnet-mvc/scheduler) also remove that group name from calendar view, i'm doing it by filtering the datasource of resource.

But then i need to use scheduler.view(scheduler.viewName()) to repaint calendar and it makes post to get information to server. I would like to remove this unnecessary request, because i'm getting data via filter button and on scheduler navigate.

Is there any way to remove unnecessary request.

I'm attaching the modified view file from example package.

 

Veselin Tsvetanov
Telerik team
 answered on 03 Apr 2018
2 answers
612 views

Hello,

Why this error is appears every time when I run the program?
Error: “An element with the same key has already been added”
I have two grids on the page. IDs GRIDs is different.

Thanks.

Olexandr
Top achievements
Rank 1
 answered on 02 Apr 2018
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
Security
ColorPicker
DateRangePicker
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
DropDownButton
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
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
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?