Telerik Forums
UI for ASP.NET MVC Forum
1 answer
134 views

Hi,

 

Currently i am experiencing an issue with the built in Editor, It is pre-filling with content fine, saving and submitting fine, however in Chrome and Edge when pasting content of any type e.g just a single word at the top of the content,the editor scrolls down to the bottom of the content. The pasting works fine and everything is displayed as it should be after scrolling up to find it.

 

This works as expected in Firefox just not in Chrome and Edge.

 

I am building up the editor as follows, I have tried removing the stylesheets and encode attribute to see if these were causing any issues to no avail, the content would just be some HTML, i have tested with some plain text and still get the issue:

 

@(Html.Kendo().Editor()
                    .Name("reportContent")
                    .HtmlAttributes(new { style = "width: 100%; height: 500px" })
                    .Tools(tools => tools
                        .Clear()
                        .ViewHtml()
                        .Bold().Italic().Underline().Strikethrough()
                        .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
                        .InsertUnorderedList().InsertOrderedList()
                        .TableEditing()
                        .CleanFormatting()
                        .Formatting()
                        .FontName()
                        .FontSize()
                        .FontColor().BackColor()
                    )
                .Value(@template)
                .Encode(true)
                .StyleSheets(c => c
                    .Add(Url.Content("~/Styles/CKEditor.css")))
            )

Any help would be appreciated :)

 

Neli
Telerik team
 answered on 23 Jan 2018
1 answer
265 views

My client has a requirement for a drop down to appear in two different places on the same form. This hasn't been an issue until I went to convert all my dropdowns to Telerik dropdowns. To maintain integrity I attached a handler that meant that changing one dropdown also affected the other.

It doesn't seem, however, that Telerik likes this. It seems to only affect the first instance of the element it encounters on the page.

01.@(Html.Kendo().DropDownListFor(model => model.GrantType)
02.                      .OptionLabel("Please Select...")
03.                      .BindTo((IEnumerable<SelectListItem>)ViewBag.GrantTypes)
04.                      .Filter(FilterType.Contains)
05.                      .Events(events =>
06.                      {
07.                          events.Select("caseBuildingGrantTypeSelectHandler");
08.                          events.DataBound("caseBuildingGrantTypeOnDataBoundHandler");
09.                      })
10.                      )

 

The second element for this model property is left as a text element.

See the attached file for example of what is happening.

 

Neli
Telerik team
 answered on 23 Jan 2018
1 answer
516 views

Hello. 

I have a telerik kendo grid and I need to display columns dynamically based on the Year which a user selects from a dropdownlist. Let's say the user selects 2015 from the dropdown, then columns 2015 to 2024 should be visible.

Adding the columns dynamically through code was a bit fussy so I set the hidden property to true when defining the grid and I have added code to the onDataBinding event to show the required columns. My code is as follows:

    function onDataBinding(e) {
        var grid = $("#grid").data("kendoGrid");
      
        //hide all columns for years first then display required columns
        var initialYear = 2015;
        for (var i = 0; i < 45; i++) {
            var column = 'C' + (initialYear + i);
            grid.hideColumn(column);
        }

        var financialYearInInt = parseInt(currentFY); //currentFY is the year which user selects from dropdownlist
        for (var i = 0; i < 10; i++) {
            var columnName = 'C' + (financialYearInInt + i);
            grid.showColumn(columnName);
        }
    }

 

This is working perfectly as shown in the Current.JPG attachment.

Now I need to add a Title to the columns, that is on top of columns 2015 and 2016, I need to have 'Forecast' as show in RequiredOutcome attachment.

I need to add the title dynamically as if let's say the user select year 2018 from the dropdownlist, then columns 2018 to 2027 will be visible and I need to add the title 'Forecast' to column 2018 and 2019.

Please advise how I can address this.

Thanks

Preslav
Telerik team
 answered on 23 Jan 2018
7 answers
372 views
Is it possible to use the PanelBarBuilder to accomplish this? I see that there are various BindTo methods available.

Or..

Can I create PanelBarItem with trees embedded? It seems as though only text is possible.

I'm not even sure where to begin. Can anyone please provide an example to get me started?
Dimitar
Telerik team
 answered on 23 Jan 2018
4 answers
780 views
Is there a way to specify a dynamic name for the export to Excel function?  The FileName() method takes a string, but I want the name to reflect certain filter conditions within the grid, and need to change the name of the exported file.  Ideally, I'd like to be able to call a javascript function that would build the name dynamically.  Any way to accomplish this?
Alex Hajigeorgieva
Telerik team
 answered on 23 Jan 2018
3 answers
574 views

I've got a workbook that is writing values from a tab delimited file into a new excel workbook.

 

Within this, I've got cells that have values that are numbers but need to be formatted as text, as these numbers contain a leading zero.

 

I'm using the Telerik.Web.Spreadsheet namespace to do this and all seems to be working well until I save the file.

 

I've inspected my collection before calling the Save method on the workbook and the numbers in the cell are correct (i.e they have a leading zero) but as soon as I call save and open the file, the zeros are removed.

 

I've checked to make sure that the cells are being correctly formatted as text (they are all text) yet the cell consistently removes the leading zero.

 

What gives and how can I fix this? I've been at this for two days now and I'm getting nowhere - any help would be GREATLY received.

 

Kind regards,

 

Ben

Nencho
Telerik team
 answered on 23 Jan 2018
2 answers
262 views

Dear Team,

I have been using Kendo Listbox for a while now and recently, i have come accross an issue with respect to vertical scroll issue in IE. The scroll bar scrolls back to top if any item in the end of the list box is selected which is little confusing as my users are unable to know whether the item is selected or not.

So, is there any fix available for this issue. Please let me know...

Thanks

Krishna
Top achievements
Rank 1
 answered on 23 Jan 2018
2 answers
794 views

As I understand it, when you have locked column in the grid there will be two separate table elements for the data items - one for locked columns and one for the regular ones.  I haven't stumbled across how to address the two separate table elements separately.  The code below works beautifully until you start locking columns.  If any columns are locked, the fieldName will wind up containing the name of an adjacent column.

 I need to determine how to get the correct column names during edit regardless of their locked/unlocked condition.  Any help or suggestions are greatly appreciated.  -Darron

<script>

    var currentItem;
    var currentColumn;

    function grid_edit(e) {
        var grid = this;
        var model = grid.dataItem(grid.current().closest("tr"));
        currentItem = model;
        var fieldName = grid.columns[e.container.index()].field;
        currentColumn = fieldName;
        if (currentColumn == "Contact" || currentColumn == "ShipFrom" || currentColumn == "ShipTo")
        {
            showModalPopUp(currentColumn);
        }

} </script>

Stefan
Telerik team
 answered on 22 Jan 2018
1 answer
344 views

Hi,

The recent version has a dependency on jQuery 1.12.4. This is strange for me as previous versions were including 1.12.3. The version 1.12.4 has a serious security vulnerability https://snyk.io/test/npm/jquery/1.12.4?severity=high&severity=medium&severity=low . On the other hand 1.12.3 does not have it https://snyk.io/test/npm/jquery/1.12.3?severity=high&severity=medium&severity=low.

So my questions:

1) Why the version was upgraded?

2) Is it save to replace jquery.min.js content with the 1.12.3 version ?

3) Is it save to replace jquery.min.js content with the 3.x version ? I have found the compatibility list for UI for jQuery (https://docs.telerik.com/kendo-ui/intro/installation/prerequisites#supported-jquery-versions) - I hope MVC is the same code with additional MVC wrappers.

Bozhidar
Telerik team
 answered on 22 Jan 2018
1 answer
283 views

I have a grid on a page, and when the user double clicks one of the rows, it opens the popup editor for the selected record.  But if the user had scrolled down the page to select the record, when the popup opens, it re-scrolls to the top of the page.  Very disconcerting for the user.  

I'm using a custom template, and not setting the top position anywhere.  Is there anyway to change how this behaves?

@(Html.Kendo().Grid<MasterPolicy>()
      .Name("policyGrid")
      .Columns(cols =>
      {
          cols.Bound(c => c.ClientId).Title("ID").Width(75);
          cols.Bound(c => c.ClientLegalName).Title("Legal Name");
          cols.Bound(c => c.ClientDBAName).Title("DBA Name");
          cols.Bound(c => c.LocationCode).Title("Location").Width(100);
          cols.Bound(c => c.LocationWCState).Title("WC State").Width(100);
          cols.ForeignKey(f => f.ProviderId, (IEnumerable) ViewData["providers"], "RecordId", "ProviderName").Title("Provider");
          cols.Bound(c => c.PolicyId);
          cols.Bound(c => c.EffectiveDate).Format("{0:d}").Title("Effective").Width(100);
          cols.Bound(c => c.ExpirationDate).Format("{0:d}").Title("Expiration").Width(100);
          cols.Bound(c => c.PEO).Width(75);
          cols.Bound(c => c.IsError).Title("Error").ClientTemplate(
              "<div style='text-align: center'>" +
              "# if (IsError) { # " +
              "<img src='" + Url.Content("~/Content/redcircle.png") + "' height='16' width='16'/>" +
              "# } else { # " +
              "<img src='" + Url.Content("~/Content/greencircle.png") + "' height='16' width='16'/>" +
              "# } #" +
              "</div>").HtmlAttributes(new { style="padding: 0 0 0 0 !important;"}).Width(75);
          cols.Command(c =>
          {
              c.Edit();
              c.Destroy();
          });
      })
      .Resizable(r => r.Columns(true))
      .Scrollable(s => s.Height("auto"))
      .Sortable()
      .Pageable(p => p.PageSizes(new List<object> { 10, 20, 30, 40, 50, 100, 250, 500 }).Refresh(true).ButtonCount(10))
      .Filterable(f => f.Enabled(true))
      .Selectable(s => s.Mode(GridSelectionMode.Single))
      .Events(ev =>
      {
          ev.DataBound("gridBound");
          ev.Edit("setMode");
          ev.Change("selectionChanged");
      })
      .AutoBind(true)
      .DataSource(ds => ds
          .Ajax()
          .Group(g =>
          {
              g.Add(c => c.ClientId);
          })
          .PageSize(25)
          .ServerOperation(true)
          .Model(m =>
          {
              m.Id(d => d.RecordId);
              m.Field(d => d.ClientId);
              m.Field(d => d.ClientLegalName);
              m.Field(d => d.ClientDBAName);
              m.Field(d => d.LocationCode);
              m.Field(d => d.LocationWCState);
              m.Field(d => d.ProviderId);
              m.Field(d => d.PolicyId);
              m.Field(d => d.EffectiveDate);
              m.Field(d => d.ExpirationDate);
              m.Field(d => d.PEO);
              m.Field(d => d.IsError);
              m.Field(d => d.Notes);
          })
          .Update(u => u.Action("SavePolicy", "Policy"))
          .Read(r => r.Action("GetPolicies", "Policy").Type(HttpVerbs.Get))
          .Destroy(c => c.Action("DeletePolicy", "Policy"))
          .Events(ev =>
          {
              ev.RequestEnd("requestEnd");
              ev.RequestStart("requestStart");
          })
      )
      .ToolBar(tb =>
      {
          tb.Custom().Text("Add New Policy").HtmlAttributes(new {id = "addNewPolicy", style = "float:left"});
          tb.Custom().Text("Clear Filter").HtmlAttributes(new { id = "gridFilterReset", style = "float:right;" });
          tb.Custom().Text("Collapse Groups").HtmlAttributes(new { id = "gridCollapseGroups", style = "float:right;" });
          tb.Custom().Text("Expand Groups").HtmlAttributes(new { id = "gridExpandGroups", style = "float:right;" });
          tb.Custom().Text("Run Integrity Check").HtmlAttributes(new {id = "checkIntegrity", style = "float:right;"});
          // tb.Custom().Text("DEV Save Settings").HtmlAttributes(new { id = "gridSaveSettings", style = "float:left;" });
      })
      .Editable(e => e.Mode(GridEditMode.PopUp).TemplateName("PolicyEdit").Window(w => w.Title("Edit Master Policy").Width(700)))
      .Groupable())

 

Stefan
Telerik team
 answered on 19 Jan 2018
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?